SVG AI Generation API
Create or reinterpret artwork; an image reference may be redrawn.
Create or reinterpret artwork; an image reference may be redrawn.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/svgai-org:svgai-org-generation-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: SVG AI REST Generation API
version: 1.0.0
description: Generate new SVG designs from text or image references, or vectorize existing raster artwork. API keys are created in the signed-in API & MCP console. Generation and vectorization require paid account access and sufficient credits; website starter credits alone do not unlock API use. GET /api/v1/credits reports current access, balance and operation costs. Examples use sample identifiers, balances and SVG artwork. Creation requests are not idempotent; poll an accepted generation before retrying.
contact:
url: https://www.svgai.org/contact
servers:
- url: https://www.svgai.org
description: Production API; authenticated operations use the account's real credits.
security:
- BearerApiKey: []
- HeaderApiKey: []
tags:
- name: Generation
description: Create or reinterpret artwork; an image reference may be redrawn.
paths:
/api/v1/generate:
post:
operationId: generateSvg
tags:
- Generation
summary: Generate SVG designs from text, an image, or both
description: Requires paid access and available credits. Generation can reinterpret an image; use vectorizeSvg for tracing. By default waits for the generation worker, then checks for results within the remaining wait window. Client or hosting timeouts can interrupt the response. Use wait=false to receive HTTP 202 with a relative poll_url without waiting for generation. An unfinished wait also returns HTTP 202. Account limits apply. Requests are not idempotent.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateRequest'
example:
prompt: An orange square centered on a transparent canvas
model: classic
variations: 1
transparent_background: 'on'
aspect_ratio: square
wait: true
responses:
'200':
description: No variations remain processing and at least one completed. Inspect each svgs entry because other variations may have failed. Example SVG and account values are illustrative.
content:
application/json:
schema:
$ref: '#/components/schemas/GenerationResponse'
example:
object: svg.generation
id: 6dce86db-468b-4bc9-b877-379a9c0894a1
status: completed
model: classic
credits_used: 2
credits_remaining: 18
svgs:
- design_id: 8acc61ce-59b4-4562-b67c-9e4a1ca55115
status: completed
svg: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="#ea580c" d="M12 12h40v40H12z"/></svg>
headers:
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
'202':
description: Generation is processing. GET the relative Location header or matching poll_url using the same account's API key.
content:
application/json:
schema:
$ref: '#/components/schemas/GenerationResponse'
example:
object: svg.generation
id: 6dce86db-468b-4bc9-b877-379a9c0894a1
status: processing
model: classic
credits_used: 2
credits_remaining: 18
svgs:
- design_id: 8acc61ce-59b4-4562-b67c-9e4a1ca55115
status: processing
svg: null
poll_url: /api/v1/generations/6dce86db-468b-4bc9-b877-379a9c0894a1
headers:
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
Location:
description: Relative authenticated generation status URL, identical to poll_url. Present only on this accepted generation response; it does not promise completion or duplicate-safe resubmission.
schema:
type: string
format: uri-reference
example: /api/v1/generations/6dce86db-468b-4bc9-b877-379a9c0894a1
'400':
description: Invalid input. Read error.message for the rejected field.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
'401':
description: Missing, invalid, or revoked API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
type: authentication_error
message: 'Missing API key. Pass it as "Authorization: Bearer sk_svgai_..." (create keys at https://svgai.org/dashboard/api).'
'402':
description: Paid access or sufficient credits are required. Inspect error.type, upgrade_url and credit fields when present.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
'429':
description: Account rate limit exceeded. error.retry_after_seconds indicates the retry delay when available.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
Retry-After:
description: Seconds to wait before retrying, matching error.retry_after_seconds from the existing account limiter.
schema:
type: integer
minimum: 1
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
'500':
description: Unexpected server failure.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
'502':
description: Generation failed. May return a failed generation object or an error envelope; inspect the body.
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/GenerationResponse'
- $ref: '#/components/schemas/ErrorResponse'
headers:
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
/api/v1/generations/{id}:
get:
operationId: getGeneration
tags:
- Generation
summary: Read a generation owned by the authenticated account
description: Poll after HTTP 202. A successful HTTP response may still have processing or failed status. This response does not include model, credit fields, or poll_url.
parameters:
- name: id
in: path
required: true
description: Generation id returned by POST /api/v1/generate.
schema:
type: string
format: uuid
responses:
'200':
description: Current generation status and available SVGs.
content:
application/json:
schema:
$ref: '#/components/schemas/GenerationStatus'
headers:
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
'400':
description: Invalid input. Read error.message for the rejected field.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
'401':
description: Missing, invalid, or revoked API key.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
type: authentication_error
message: 'Missing API key. Pass it as "Authorization: Bearer sk_svgai_..." (create keys at https://svgai.org/dashboard/api).'
'404':
description: No generation with that id exists for this account.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
'429':
description: Account rate limit exceeded. error.retry_after_seconds indicates the retry delay when available.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
Retry-After:
description: Seconds to wait before retrying, matching error.retry_after_seconds from the existing account limiter.
schema:
type: integer
minimum: 1
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
'500':
description: Unexpected server failure.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
headers:
RateLimit-Policy:
$ref: '#/components/headers/RateLimitPolicy'
RateLimit:
$ref: '#/components/headers/RateLimit'
components:
schemas:
ErrorResponse:
type: object
required:
- error
properties:
error:
$ref: '#/components/schemas/ApiError'
GenerationResponse:
allOf:
- $ref: '#/components/schemas/GenerationStatus'
- type: object
required:
- model
- credits_used
- credits_remaining
properties:
model:
type: string
enum:
- classic
- ultra
credits_used:
type: number
description: Credits charged or reserved for this request.
credits_remaining:
type: number
description: Remaining account balance reported for the request.
poll_url:
type: string
description: Relative authenticated polling URL, present when status is processing.
error:
$ref: '#/components/schemas/ApiError'
ApiError:
type: object
required:
- type
- message
properties:
type:
type: string
enum:
- invalid_request
- authentication_error
- permission_error
- insufficient_credits
- payment_required
- rate_limit_exceeded
- not_found
- generation_error
- server_error
message:
type: string
description: Human-readable explanation.
retry_after_seconds:
type: number
description: Optional retry delay for rate_limit_exceeded.
credits_remaining:
type: number
description: Optional available balance for insufficient_credits.
credits_required:
type: number
description: Optional required credits for insufficient_credits.
upgrade_url:
type: string
format: uri
description: Optional upgrade URL for payment_required.
GenerateRequest:
type: object
description: At least one nonempty prompt, image or image_url is required. image and image_url cannot both be supplied. These schemas describe the recommended canonical input types; the server also normalizes some string/boolean aliases.
properties:
prompt:
type: string
maxLength: 4000
description: Plain-language design brief. Optional with an image; whitespace-only text is empty.
image:
type: string
minLength: 100
description: Raw base64 or an image data URL. PNG, JPEG, or WebP; up to 8 MB decoded. Do not send together with image_url.
image_url:
type: string
format: uri
pattern: ^https?://
description: Publicly reachable HTTP(S) image URL. Private/reserved hosts are rejected; up to 8 MB downloaded. Do not send together with image.
model:
type: string
enum:
- classic
- ultra
default: classic
description: Generation model. Check current costs through GET /api/v1/credits.
variations:
type: integer
minimum: 1
maximum: 4
default: 1
description: Each variation uses credits.
transparent_background:
type: string
enum:
- auto
- 'on'
- 'off'
default: auto
aspect_ratio:
type: string
enum:
- default
- square
default: default
wait:
type: boolean
default: true
anyOf:
- required:
- prompt
properties:
prompt:
minLength: 1
pattern: \S
- required:
- image
- required:
- image_url
not:
required:
- image
- image_url
GenerationStatus:
type: object
required:
- object
- id
- status
- svgs
properties:
object:
type: string
const: svg.generation
id:
type: string
format: uuid
status:
type: string
description: Processing while any variation is processing; completed when none are processing and at least one completed; failed when none completed. Inspect each svgs entry for its individual outcome.
enum:
- completed
- processing
- failed
svgs:
type: array
items:
$ref: '#/components/schemas/GeneratedSvg'
GeneratedSvg:
type: object
required:
- design_id
- status
- svg
properties:
design_id:
type: string
format: uuid
status:
type: string
enum:
- completed
- processing
- failed
svg:
type:
- string
- 'null'
description: Complete SVG markup when available; null while processing or when unavailable.
headers:
RateLimit:
description: Optional observed remaining request quota (r) and effective-window hint in seconds (t), calculated when responding. Concurrent requests can change available quota; this is not an acceptance, retry or full-reset guarantee. Omitted when authentication has not reached the limiter, the limiter is unavailable, or the observation is expired or invalid.
schema:
type: string
example: '"generate";r=19;t=60'
RateLimitPolicy:
description: Optional observed per-user request-rate policy, shared across the account's API keys. q counts requests, not credits; w is the policy window in seconds. Omitted without a valid unexpired limiter observation. Uses the IETF HTTPAPI RateLimit draft syntax.
schema:
type: string
example: '"generate";q=20;w=60'
securitySchemes:
BearerApiKey:
type: http
scheme: bearer
bearerFormat: SVG AI API key
description: 'Create a key at https://www.svgai.org/dashboard/api. Send Authorization: Bearer YOUR_API_KEY. REST uses API keys; OAuth is available for the separately documented MCP endpoint. Never send credentials in URLs.'
HeaderApiKey:
type: apiKey
in: header
name: x-api-key
description: Alternative API-key header. Use one authentication scheme.
externalDocs:
description: API and MCP setup, task selection, authentication and errors
url: https://www.svgai.org/docs