Coming soon. Prompt improvement is not enabled yet. Until it is,
POST /prompts/improve returns
503 service_unavailable with the message
Prompt improvement is not available yet., and the MCP tool improve_prompt does
not appear in the server’s tool list. Nothing is charged, and a disabled call does
not count against your rate limit. The credits, idempotency, and error behaviour
on this page apply from launch.POST /prompts/improve— improve one prompt fortargetimageorvideo.- The MCP server will have the same operation as the tool
improve_prompt— see MCP tools.
200 response contains the improved prompt. There
is no job to poll and no webhook.
Example: improve, then generate
Improvea red bicycle in a park for an image:
200 OK
improved_prompt as the prompt of
POST /images/generations (or of the MCP tool
generate_image). For target: "video", send it to
POST /videos/generations.
Request
Unknown body fields are ignored.
The
200 response has four fields:
Every response carries an
X-Request-ID header. Quote it when you contact support.
Order of checks
A call is checked in this order. The first check that fails decides the response:- Authentication —
401(invalid_api_key, orinvalid_tokenfor an OAuth access token). - Availability —
503 service_unavailablewhile prompt improvement is not enabled. This check runs before the rate limiter, so a disabled call does not count against your rate limit. - Rate limit —
429 rate_limited. - Scope —
403 missing_scope. - Validation —
422 validation_error.
Credits
From launch, each call costs 1 credit. The credit is charged before the AI model runs:- If the balance this credential can spend is too low, the call returns
402— nothing is charged and the model does not run. See When you run out of credits. - If the AI provider fails, the credit is refunded automatically and the call
returns
502 provider_error. - In the rare case that the refund cannot be confirmed at once, the call returns
500 refund_pending. Samsa retries the refund automatically — you do not need to do anything.
Idempotency
Send an optionalIdempotency-Key header (1–255 printable ASCII characters, for
example a UUID) to retry safely after a timeout or a network error:
Keys are scoped to the owner of the credential — the API key’s creator or the
OAuth user — within the organization. REST calls, MCP calls, and all credentials of
the same owner share one key namespace. Two different users can use the same key
value without a conflict.
Scope
A credential with any one of theimages.generate, images.edit, or
videos.generate scopes can call the improver — the scopes of the operations an
improved prompt is for. There is no separate scope, so existing keys work. A key with
none of the three gets 403 missing_scope.
Rate limits
Each enabled call counts against the key’s per-key request rate (429 rate_limited with Retry-After). The call creates no job, so it does not use
the organization’s concurrency cap.