API docsv1.0
Turn text and images into the next SVG in your app.
Quick start
Create a key, submit a job, wait for completion, and download your SVG. Documentation is public; API calls require a key.
https://momovector.com/api/v1- 01On the API management page create a key and save it as a server environment variable
MOMOVECTOR_API_KEY。 - 02Set the base URL
MOMOVECTOR_BASE_URL; for each new job, generate oneMOMOVECTOR_REQUEST_IDand reuse it for retries. - 03After submitting, save
job.idand poll every 2–3 seconds. Download with your key once complete.
export MOMOVECTOR_BASE_URL='https://momovector.com'
# Generate once per new job; do not rerun this line for network retries
export MOMOVECTOR_REQUEST_ID="$(python3 -c 'import uuid; print(uuid.uuid4())')"curl 'https://momovector.com/api/v1/generations' \
-H "Authorization: Bearer $MOMOVECTOR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $MOMOVECTOR_REQUEST_ID" \
-d '{"mode":"text","prompt":"A cute little orange cat","style":"playful"}'
# Set JOB_ID to job.id from the response
export JOB_ID='YOUR_JOB_ID'
curl "$MOMOVECTOR_BASE_URL/api/v1/generations/$JOB_ID" \
-H "Authorization: Bearer $MOMOVECTOR_API_KEY"
# Download once status is completed
curl "$MOMOVECTOR_BASE_URL/api/v1/generations/$JOB_ID/file" \
-H "Authorization: Bearer $MOMOVECTOR_API_KEY" \
--output artwork.svgdemo: true and uses built-in artwork. Live generation requires a configured model service. Authentication and keys
Send X-App-Language: zh-CN for Chinese or en for English. Otherwise, browser language preferences are used, with English as the fallback. Fields, error codes, and user content stay unchanged.
All data endpoints require the header Authorization: Bearer <API_KEY>. Keys are shown only once on creation. Set an expiration and revoke them at any time.
Authorization: Bearer mv_sk_...
Content-Type: application/json
Idempotency-Key: required only when submitting a new job- Keys expire after 90 days by default. Choose 30, 90, 365 days, or no expiration. Each account supports up to 10 active keys.
- Keys can generate, query, and download your artwork. They cannot buy credits, delete artwork, or manage other keys.
- The public API requires a Bearer key, not cookies or URL parameters. It is intended for servers and scripts.
- Use HTTPS in production. Keep keys in server environment variables, never in frontend code.
- Revoking a key blocks future authentication. Submitted jobs still finish, and artwork stays in the original account.
Create a generation
/generationsBearerText and image generation use the same endpoint. Send JSON; a successful request returns 202 Accepted, charges credits, and creates an asynchronous job.
| Field | Type / requirements | Description |
|---|---|---|
mode | string · required | text: text generation; image: image generation. |
purpose | string · optional | Defaults to illustration. logo accepts text, a subject image, or a sketch, with an optional style. |
inputSource | string · optional | text: text only (mode=text); image: subject image; sketch: drawing (mode=image). |
primaryColors | string[] · optional | Up to 12 #RRGGBB primary color references. Defaults to [] with no color requirements. Complementary colors are allowed. |
prompt | string · mode-dependent | Required in text mode, 1–1280 characters; optional in image mode, up to 1280 characters. |
image | string · required for images | Base64 data URL for PNG, JPEG, or WebP, up to 8 MiB decoded. Remote image URLs are not accepted. |
styleReferences | string[] · optional | Up to 8 (subject to the model’s total image limit) image data URLs (8 MiB each) or public HTTPS image URLs. Supported for text, image, and logo generation. |
style | string | null · optional | Omit, use null, or use none for no preset style. Options:business(Refined business)、tech(Future tech)、playful(Cute stickers)、flat(Flat illustration)、minimal(Minimal lines)、retro(Retro poster)、3d(3D forms)、fluid(Artistic flow)、lettermark(Lettermark)、mascot-logo(Mascot badge) |
Idempotency-Key Required header: 16–80 letters, digits, underscores, or hyphens. UUID recommended. Retrying identical content with the same key returns the original job without another charge. {
"mode": "text",
"prompt": "A cute little orange cat",
"style": "playful"
}202 · Job acceptedJSON +
{
"job": {
"id": "2a357e9c-a431-42c4-9d73-bfb2b265712a",
"mode": "text",
"prompt": "A cute little orange cat",
"style": "playful",
"status": "queued",
"cost": 9,
"source": "api",
"demo": false,
"error": null,
"createdAt": "2026-09-26T20:00:00.000Z",
"url": null
}
}Response headers Location is the job status URL;Retry-After: 2 recommends polling after two seconds.202 means the job was accepted, not completed.
Style reference images
/generationsBearerUse styleReferences for palette, line work, and visual style references. The text description or image still determines the subject. Selected primary colors guide the palette. Reference images cost no extra credits.
{
"mode": "text",
"prompt": "A fox sitting on the moon",
"style": "flat",
"styleReferences": [
"https://images.example.com/style.png",
"data:image/webp;base64,..."
]
}- Up to 8 (subject to the model’s total image limit) references, mixing files and URLs. Uploaded files support PNG, JPG, and WebP, up to 8 MiB each when decoded.
- URLs must point directly to public HTTPS images, not webpages, local addresses, or redirects. Images are downloaded to private storage before charging, with the same 8 MiB limit. If saving fails, generation does not begin.
- Changing reference content or order requires a new Idempotency-Key. Retrying identical content does not charge again.
- In the response,
styleReferencesURLs with kind=upload require the same account's Bearer key. Read them viaGET /api/v1/generations/{id}/references/{index}. New URL references also return an archived URL; sourceUrl retains the original link. Older kind=url records may link externally. Never send a MomoVector API key to external addresses. - References are stored privately with the artwork and deleted with it. The Python example supports repeated
--reference style.pngor--reference https://…。
Sketches, icons, and logos
/api/v1/generationsBearerUse purpose=illustration for general artwork and purpose=logo for icons or logos. Text-only requests use mode=text and inputSource=text, costing 9 credits. Images and sketches use mode=image and inputSource=image or sketch, costing 9 credits. Failed jobs are refunded.
{
"mode": "image",
"purpose": "logo",
"inputSource": "sketch",
"style": "none",
"primaryColors": [
"#24483F",
"#BF573A"
],
"prompt": "A mountain coffee shop; retain the mountain outline, simple and bold",
"image": "data:image/png;base64,..."
}style can be omitted, null, none, or any preset. prompt is required for text logos and optional for images or sketches, with a maximum of 1280 characters. primaryColors is an optional array of up to 12 #RRGGBB colors. Omit it or use [] for a free palette. Selected colors guide the palette while allowing complementary colors. Explicitly request monochrome in prompt if needed.
Legacy logoSource still works with purpose=logo; use inputSource in new requests. Legacy primaryColor specifies one primary color, not monochrome, and cannot be combined with primaryColors.
purpose, primaryColors, and inputUrl record your input. Request with the same account's Bearer key: GET /api/v1/generations/{id}/input to read the source sketch. Once complete, use /file to download the SVG.
python momovector_api.py --image sketch.png --purpose logo --primary-color '#24483F' --output logo.svgEnhance prompt
/prompt-enhancementsBearerExpand a brief idea with composition, subject, hierarchy, and relevant visual details. Keep the original language and requirements, with the option to undo.
Returns enhanced text without creating a generation. Credits are charged separately by usage; see your credit history for charges. No hourly attempt limit; one request at a time. Identical content is cached for one hour without another charge. Input and output are limited to 1280 characters.
{
"prompt": "A mountain coffee shop logo that retains the mountain outline"
}The response is {prompt: "Enhanced description", cached: false}. Returns 503 if the text model is not configured. The original prompt can still be used to generate.
Check job status
/generations/{id}Bearerid Use the submission response's job.id. You can only read jobs belonging to your account.
queuedWaiting to startrunningCreatingcompletedReady to downloadfailedFailed; credits refunded| Field | Type / requirements | Description |
|---|---|---|
id / createdAt | string | Job UUID / ISO 8601 creation time. |
mode / prompt / style | string | Request mode, prompt, and selected style. |
status | string | queued, running, completed, or failed. |
cost | integer | Credits charged for this generation. |
source | string | web or api: where the artwork was created. |
demo | boolean | true indicates demo artwork. |
error | string | null | A safe, user-facing failure message, including a recognized reason (such as content filtering) and refund information; otherwise null. |
url | string | null | An authenticated relative SVG URL on success; null before completion. |
200 · Generation completeJSON +
{
"job": {
"id": "2a357e9c-a431-42c4-9d73-bfb2b265712a",
"mode": "text",
"prompt": "A cute little orange cat",
"style": "playful",
"status": "completed",
"cost": 9,
"source": "api",
"demo": false,
"error": null,
"createdAt": "2026-09-26T20:00:00.000Z",
"url": "/api/v1/generations/2a357e9c-a431-42c4-9d73-bfb2b265712a/file"
}
}Download SVG
/generations/{id}/fileBearerOnce the job is completed , the endpoint returns an SVG with content type image/svg+xml; charset=utf-8and a download filename. This is not a public sharing URL; every download requires a Bearer key.
Optional background parameter:transparent(default) or a six-digit HEX color. For example, ?background=%23F4EBDD downloads an SVG with a warm paper background, preserving vector paths at no extra charge. In URLs, # must be encoded as %23。
curl "$MOMOVECTOR_BASE_URL/api/v1/generations/$JOB_ID/file" \
-H "Authorization: Bearer $MOMOVECTOR_API_KEY" \
--output artwork.svgAn incomplete job returns 409 result_not_ready; missing, deleted, or another account's artwork returns 404 not_found。
Image links & API
/generations/{id}/media/variantsBearerCreate PNG, WebP, JPEG or SVG sizes without model calls or generation credit charges. Public access is off by default. Only the artwork owner can create sizes or enable public access.
curl "$MOMOVECTOR_BASE_URL/api/v1/generations/$JOB_ID/media/variants" -H "Authorization: Bearer $MOMOVECTOR_API_KEY" -H "Content-Type: application/json" -d '{"w":1024,"fm":"webp","q":85}'List sizes with GET /generations/{id}/media. POST {"enabled":true} to /generations/{id}/media/public to allow public access. Returned URLs work with fetch and img tags without tokens. Turning public access off blocks subsequent requests.
Public links only support registered sizes and do not expire. Evicted cache files are restored automatically without AI calls. Up to 2048 px per side and 32 sizes per artwork.
w, h, fm, q, fit, dpr, bg — Supports aspect ratio preservation, padding, cropping and backgrounds. auto=format is not supported. See the downloadable documentation for full parameters, quotas, deletion and examples.
Get history
/generationsBearerReturns web and API artwork for the account, newest first, 24 per page. The artwork's source identifies its source.
| Field | Type / requirements | Description |
|---|---|---|
offset | integer · optional | Defaults to 0, range 0–100000. Use nextOffset from the response for the next page. |
curl "$MOMOVECTOR_BASE_URL/api/v1/generations?offset=0" \
-H "Authorization: Bearer $MOMOVECTOR_API_KEY"200 · HistoryJSON +
{
"items": [
{
"id": "2a357e9c-a431-42c4-9d73-bfb2b265712a",
"mode": "text",
"prompt": "A cute little orange cat",
"style": "playful",
"status": "completed",
"cost": 9,
"source": "api",
"demo": false,
"error": null,
"createdAt": "2026-09-26T20:00:00.000Z",
"url": "/api/v1/generations/2a357e9c-a431-42c4-9d73-bfb2b265712a/file"
}
],
"hasMore": false,
"nextOffset": 24
}hasMore Stop paging when this is false.items Each entry uses the same job field format.
Check credits
/creditsBearerReturns available credits, generation cost, demo status, and account limits. Credits purchased on the web work with the API.
curl "$MOMOVECTOR_BASE_URL/api/v1/credits" \
-H "Authorization: Bearer $MOMOVECTOR_API_KEY"200 · Account creditsJSON +
{
"balance": 60,
"costs": {
"text": 9,
"image": 9
},
"demo": false,
"limits": {
"requestsPerMinute": 60,
"activeKeys": 10,
"concurrentJobs": 4
}
}Error codes and recovery
All public API errors include an HTTP status and consistent JSON. Keep the error.requestIdfor troubleshooting; it matches the response header X-Request-Id .
{
"error": {
"code": "insufficient_credits",
"message": "Not enough credits. Buy credits on the website and try again.",
"requestId": "fdba965d-0c4c-439b-81d1-c2bc3db23ae0"
}
}| HTTP | code | Suggested action |
|---|---|---|
| 400 | invalid_request / invalid_image / invalid_reference | Correct the request parameters, request ID, or image content. |
| 401 | invalid_api_key | Check that your Bearer key is valid, unexpired, and not revoked. |
| 402 | insufficient_credits | Add credits on the website and try again. |
| 404 | not_found | Check the endpoint, job ID, and account ownership. |
| 405 | method_not_allowed | Use the GET or POST method listed in the docs. |
| 409 | idempotency_conflict | This request ID was used for different content or deleted artwork. Use a new ID for a new job. |
| 409 | result_not_ready | The job is not complete yet. Keep checking its status. |
| 413 | payload_too_large | Reduce the image or request body size. |
| 429 | rate_limited / concurrency_limit | Wait for the Retry-After interval and keep the same request ID when retrying. |
| 500 | internal_error | Keep the request ID and use bounded retries. |
| 503 | service_unavailable | Generation is not configured or temporarily unavailable. Try again later. |
Billing, rate limits, and retries
Each account allows up to 60 public API requests per UTC minute across all keys, including submissions, queries, and downloads. OpenAPI docs are excluded. Web and API share a limit of 4 concurrent generations.
| Field | Type / requirements | Description |
|---|---|---|
X-RateLimit-Limit | integer | Maximum requests per minute. |
X-RateLimit-Remaining | integer | Requests remaining in the current window. |
X-RateLimit-Reset | integer | Unix timestamp in seconds when the window ends. |
Retry-After | integer | Suggested delay in seconds for 429; polling delay for 202. |
- For network retries of the same job, always reuse the original
Idempotency-Keywith identical content. All keys and web requests for an account share the idempotency scope. - Using the same key with different content, deleted artwork, or an older job without a fingerprint returns
409 idempotency_conflict。 - For 429, follow
Retry-After; for network or 5xx errors, use bounded retries with a delay. - After a job is accepted, retain
job.id. Failed generations are refunded automatically. Use a new request ID to create again.