import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["NAGA_API_KEY"],
base_url="https://api.naga.ac/v1",
)
result = client.images.generate(
model="openai/gpt-image-2.5-sunburst-2026-09-08",
prompt="A watercolour fox in a snowy forest",
size="1024x1024",
n=1,
)
print(result)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.NAGA_API_KEY,
baseURL: "https://api.naga.ac/v1",
});
const result = await client.images.generate({
model: "openai/gpt-image-2.5-sunburst-2026-09-08",
prompt: "A watercolour fox in a snowy forest",
size: "1024x1024",
n: 1,
});
console.log(result);
curl https://api.naga.ac/v1/images/generations \
-H "Authorization: Bearer $NAGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-image-2.5-sunburst-2026-09-08",
"prompt": "A watercolour fox in a snowy forest",
"size": "1024x1024",
"n": 1
}'
Creates images from a text prompt and charges the account for what it counted. Requires an API key. /v1/images/edits changes images that were uploaded instead. A result that takes over 60 seconds arrives with status 200, and a failure then as an error object in the body. See Errors.
POST
https://api.naga.ac
/
v1
/
images
/
generations
openai-python
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["NAGA_API_KEY"],
base_url="https://api.naga.ac/v1",
)
result = client.images.generate(
model="openai/gpt-image-2.5-sunburst-2026-09-08",
prompt="A watercolour fox in a snowy forest",
size="1024x1024",
n=1,
)
print(result)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.NAGA_API_KEY,
baseURL: "https://api.naga.ac/v1",
});
const result = await client.images.generate({
model: "openai/gpt-image-2.5-sunburst-2026-09-08",
prompt: "A watercolour fox in a snowy forest",
size: "1024x1024",
n: 1,
});
console.log(result);
curl https://api.naga.ac/v1/images/generations \
-H "Authorization: Bearer $NAGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-image-2.5-sunburst-2026-09-08",
"prompt": "A watercolour fox in a snowy forest",
"size": "1024x1024",
"n": 1
}'
An account API key. Send it as Authorization: Bearer <key>.
Body
application/json
The request body of POST /v1/images/generations.
model
string
required
The model to generate with, named by its id or alias.
prompt
string
required
What to generate, in words. One to 8192 characters, and moderation screens it first.
models
string[] | null
Fallback models, tried in order when model cannot answer: none of its providers served it, or the request does not fit it. At most 3, and only the model that answered is billed. A NagaAI extension in OpenRouter's shape.
Maximum array length: 3
routing
object
How NagaAI picks the providers for this request: max_price removes the dearer ones and can fail the request. Takes no strategy. A NagaAI extension.
Hide child attributes
routing.max_price
object
The most one unit of each named meter may cost. Absent: no price limit.
Hide child attributes
routing.max_price.token
stringnumber
Credits per token, either direction, without a meter of its own. A non-negative decimal, as a string or a number.
routing.max_price.input_token
stringnumber
Credits per prompt token without a meter of its own. A non-negative decimal, as a string or a number.
routing.max_price.output_token
stringnumber
Credits per output token without a meter of its own. A non-negative decimal, as a string or a number.
routing.max_price.cached_input_token
stringnumber
Credits per prompt token read from cache. A non-negative decimal, as a string or a number.
routing.max_price.cache_write_input_token
stringnumber
Credits per prompt token written to cache. A non-negative decimal, as a string or a number.
routing.max_price.cache_write_1h_input_token
stringnumber
Credits per prompt token cached for one hour. A non-negative decimal, as a string or a number.
routing.max_price.input_text_token
stringnumber
Credits per prompt text token. A non-negative decimal, as a string or a number.
routing.max_price.output_text_token
stringnumber
Credits per output text token. A non-negative decimal, as a string or a number.
routing.max_price.input_audio_token
stringnumber
Credits per input audio token. A non-negative decimal, as a string or a number.
routing.max_price.output_audio_token
stringnumber
Credits per output audio token. A non-negative decimal, as a string or a number.
routing.max_price.input_image_token
stringnumber
Credits per input image token. A non-negative decimal, as a string or a number.
routing.max_price.output_image_token
stringnumber
Credits per output image token. A non-negative decimal, as a string or a number.
routing.max_price.input_audio_hour
stringnumber
Credits per hour of input audio. A non-negative decimal, as a string or a number.
routing.max_price.output_audio_hour
stringnumber
Credits per hour of output audio. A non-negative decimal, as a string or a number.
routing.max_price.input_text_character
stringnumber
Credits per input text character. A non-negative decimal, as a string or a number.
routing.max_price.output_text_character
stringnumber
Credits per output text character. A non-negative decimal, as a string or a number.
routing.max_price.input_text_search
stringnumber
Credits per rerank search. A non-negative decimal, as a string or a number.
routing.max_price.output_image_image
stringnumber
Credits per delivered picture. A non-negative decimal, as a string or a number.
routing.max_price.request
stringnumber
Credits per request: the fee a request pays once. A non-negative decimal, as a string or a number.
routing.max_price.output_video_second
stringnumber
Credits per second of video. A non-negative decimal, as a string or a number.
routing.max_price.output_video_megapixel_second
stringnumber
Credits per megapixel-second of video an upscale model returns. A non-negative decimal, as a string or a number.
Example:
{ "output_token": "0.000005" }
routing.precision
enum<string>[]
The weight precisions the model may be served in. Absent: any.
Minimum array length: 1
A weight precision a provider serves a model in, as it publishes it.
Available options:
int4,
int8,
fp4,
mxfp4,
nvfp4,
fp6,
fp8,
mxfp8,
fp16,
bf16,
fp32
quality
string | null
The provider's quality knob, passed through unchecked. A provider without one drops it.
size
string | null
The requested image size, written {width}x{height}; any other shape draws a refusal.
n
integer<int64> | null
How many images to ask for. Absent means one; a value above what the model declares draws a refusal.
response_format
enum<string>
default:url
Whether each image comes back as a link (url) or as inline base64 (b64_json).
Available options:
url,
b64_json
stream
boolean | null
Whether the answer comes as server-sent events instead of one JSON body: one image_generation.completed event per image, carrying it as base64 whatever response_format says.
partial_images
integer<int64> | null
How many partial images to stream before the final one, 0 to 3, with stream only. As OpenAI documents, fewer may arrive than asked; NagaAI sends the final image as soon as the provider finishes, without partials.
Response
The produced images. Each entry of data carries either a link the gateway hosts or the bytes inline, whichever response_format asked for. usage carries the count the charge was computed from. With stream, text/event-stream carries one image_generation.completed event per image instead, usage on the last.
The body both image routes answer with.
created
integer<int64>
required
When the gateway rendered this body, in seconds since the Unix epoch.
data
object[]
required
The produced images, in the order the provider returned them.
Hide child attributes
data.url
string | null
A link to the image, hosted by NagaAI rather than by the provider. The file is deleted 24 hours after it is created.
data.b64_json
string | null
The image bytes themselves, standard base64. This branch stores nothing.
usage
object
required
What the gateway metered, filling in where the provider reported nothing.
Hide child attributes
usage.output_tokens
integer<int64>
required
Output tokens charged for the produced images. Where the provider counted none, each image counts as its model's published output-token count for its resolution, or 2048 when the model publishes none.
usage.total_tokens
integer<int64>
required
The sum of input_tokens and output_tokens.
usage.input_tokens
integer<int64> | null
Input tokens charged for. Zero on a model that prices no input text token.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"NagaAI Documentation","colors":{"primary":"#5a5ae5","light":"#8893fa","dark":"#5351da"},"logo":{"light":"https://mintcdn.com/nagaai-60f8697b/iT26S8z0rCJNbf-r/static/img/logo-light.svg?fit=max\u0026auto=format\u0026n=iT26S8z0rCJNbf-r\u0026q=85\u0026s=7ad6a12d817d2e7ffb3c1296111448f0","dark":"https://mintcdn.com/nagaai-60f8697b/iT26S8z0rCJNbf-r/static/img/logo-dark.svg?fit=max\u0026auto=format\u0026n=iT26S8z0rCJNbf-r\u0026q=85\u0026s=79854e4d7ca0601b0a26ad479113b4f2"},"favicon":"https://mintcdn.com/nagaai-60f8697b/iT26S8z0rCJNbf-r/static/img/favicon.ico?fit=max\u0026auto=format\u0026n=iT26S8z0rCJNbf-r\u0026q=85\u0026s=30313e123d9a746e83d4e1c7d949c3ad","api":{"params":{"expanded":"all"},"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["python","javascript","curl","go"],"prefill":true},"url":"full"},"appearance":{"default":"system"},"background":{"color":{"light":"#ffffff","dark":"#09090b"}},"navbar":{"links":[{"href":"https://naga.ac/models","label":"Models"},{"href":"https://naga.ac/pricing","label":"Pricing"},{"href":"https://naga.ac/playground","label":"Playground"}],"primary":{"type":"button","label":"Dashboard","href":"https://naga.ac/dashboard"}},"footer":{"socials":{"discord":"https://discord.naga.ac","github":"https://github.com/naga-ai-hub","x":"https://x.com/NagaAIProject","reddit":"https://www.reddit.com/r/NagaAI"},"links":[{"header":"Community","items":[{"label":"Status","href":"https://status.naga.ac"},{"label":"Blog","href":"https://naga.ac/blog"},{"label":"Support","href":"https://discord.naga.ac"}]},{"header":"Resources","items":[{"label":"Models","href":"https://naga.ac/models"},{"label":"Playground","href":"https://naga.ac/playground"},{"label":"Chat","href":"https://chat.naga.ac"}]},{"header":"Legal","items":[{"label":"Privacy","href":"https://naga.ac/legal/privacy"},{"label":"Terms","href":"https://naga.ac/legal/terms"}]}]},"fonts":{"family":"Geist"},"styling":{"codeblocks":{"theme":{"light":"github-light-default","dark":"github-dark-dimmed"}},"latex":true},"contextual":{"options":["copy","view","download-spec","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"nagaai-60f8697b","hasAudioNarration":false,"actualSubdomain":"nagaai-60f8697b","customDomains":["docs.naga.ac"],"gitSource":{"type":"github","owner":"naga-ai-hub","repo":"naga-ai","deployBranch":"master","contentDirectory":"docs-site","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b0406c89421b24d9c4642da","clientVersion":"0.0.4271","searchFilterCounts":[{"language":"default","tag":"Docs","count":45},{"language":"default","tag":"API Reference","count":29},{"language":"default","tag":"Endpoints","count":24},{"language":"default","tag":"Account","count":19},{"language":"default","tag":"Guides","count":19},{"language":"default","tag":"Integrations","count":15},{"language":"default","tag":"Coding agents","count":9},{"language":"default","tag":"API Keys","count":5},{"language":"default","tag":"Chat formats","count":4},{"language":"default","tag":"Get started","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[]}
{"page":{"pagePath":"api-reference/images/create-an-image","slug":"/api-reference/images/create-an-image","pageMetadata":{"title":"Create an image","description":"Creates images from a text prompt and charges the account for what it counted. Requires an API key. `/v1/images/edits` changes images that were uploaded instead. A result that takes over 60 seconds arrives with status `200`, and a failure then as an `error` object in the body. See [Errors](https://docs.naga.ac/build/error-handling#errors-in-a-slow-request).","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/images/generations","href":"/api-reference/images/create-an-image","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Creates images from a text prompt and charges the account for what it counted. Requires an API key. \", _jsx(_components.code, {\n children: \"/v1/images/edits\"\n }), \" changes images that were uploaded instead. A result that takes over 60 seconds arrives with status \", _jsx(_components.code, {\n children: \"200\"\n }), \", and a failure then as an \", _jsx(_components.code, {\n children: \"error\"\n }), \" object in the body. See \", _jsx(_components.a, {\n href: \"https://docs.naga.ac/build/error-handling#errors-in-a-slow-request\",\n children: \"Errors\"\n }), \".\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light-default","dark":"github-dark-dimmed"}},"config":{},"pageMetadata":{"title":"Create an image","description":"Creates images from a text prompt and charges the account for what it counted. Requires an API key. `/v1/images/edits` changes images that were uploaded instead. A result that takes over 60 seconds arrives with status `200`, and a failure then as an `error` object in the body. See [Errors](https://docs.naga.ac/build/error-handling#errors-in-a-slow-request).","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/images/generations","href":"/api-reference/images/create-an-image","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Images"],"summary":"Create an image","description":"Creates images from a text prompt and charges the account for what it counted. Requires an API key. `/v1/images/edits` changes images that were uploaded instead. A result that takes over 60 seconds arrives with status `200`, and a failure then as an `error` object in the body. See [Errors](https://docs.naga.ac/build/error-handling#errors-in-a-slow-request).","operationId":"create_image","externalDocs":{"url":"https://platform.openai.com/docs/api-reference/images","description":"The OpenAI reference for these routes."},"requestBody":"f38c568a-59db-4416-b39e-f136a57b4a31","responses":{"200":"90740a13-0281-4f6f-afc3-38099ba19fee","400":"c68c5b9d-404b-4a03-a39b-ccb8219beefc","401":"8b958a16-e524-4210-9470-8b20d65ff830","402":"ac231fb5-c463-41c1-b2e7-c4887d309ae5","403":"a87f8ed2-7a0c-49a8-baf9-211b0f8cce1b","408":"8bce2f1c-4758-4834-ac9c-e734c419b92e","410":"072eae1f-b6fa-41e0-9841-3260c0a70b8a","413":"86660ad4-c4d4-4efc-98bb-466f19a4a3b8","422":"94451ba6-ccb4-4e8f-8717-ac5fca5b5233","429":"ce6f1742-454e-4260-8813-358225d0ce70","500":"b7c26289-00a4-4d1b-8536-99e901eb4730","503":"9554d7ff-38cc-414c-8d40-8c4176006e89"},"security":["6a1217b6-bfc0-4576-8bed-cf72b5696479","0802e71b-7a4c-473d-baa7-c2335a1b2851"],"x-codeSamples":[{"lang":"bash","label":"curl","source":"curl https://api.naga.ac/v1/images/generations \\\n -H \"Authorization: Bearer $NAGA_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"openai/gpt-image-2.5-sunburst-2026-09-08\",\n \"prompt\": \"A watercolour fox in a snowy forest\",\n \"size\": \"1024x1024\",\n \"n\": 1\n}'"},{"lang":"python","label":"openai-python","source":"import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ[\"NAGA_API_KEY\"],\n base_url=\"https://api.naga.ac/v1\",\n)\n\nresult = client.images.generate(\n model=\"openai/gpt-image-2.5-sunburst-2026-09-08\",\n prompt=\"A watercolour fox in a snowy forest\",\n size=\"1024x1024\",\n n=1,\n)\nprint(result)\n"},{"lang":"javascript","label":"openai-node","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n apiKey: process.env.NAGA_API_KEY,\n baseURL: \"https://api.naga.ac/v1\",\n});\n\nconst result = await client.images.generate({\n model: \"openai/gpt-image-2.5-sunburst-2026-09-08\",\n prompt: \"A watercolour fox in a snowy forest\",\n size: \"1024x1024\",\n n: 1,\n});\nconsole.log(result);\n"}],"x-mcp":{"name":"naga_create_image","annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":true}},"method":"post","type":"path","servers":["1d29b2f5-fc23-4c48-8460-8fa16335ed52"],"path":"/v1/images/generations","baseUrlOptions":["https://api.naga.ac"],"title":"Create an image","codeSamples":[{"label":"curl","lang":"bash","source":"curl https://api.naga.ac/v1/images/generations \\\n -H \"Authorization: Bearer $NAGA_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"openai/gpt-image-2.5-sunburst-2026-09-08\",\n \"prompt\": \"A watercolour fox in a snowy forest\",\n \"size\": \"1024x1024\",\n \"n\": 1\n}'"},{"label":"openai-python","lang":"python","source":"import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ[\"NAGA_API_KEY\"],\n base_url=\"https://api.naga.ac/v1\",\n)\n\nresult = client.images.generate(\n model=\"openai/gpt-image-2.5-sunburst-2026-09-08\",\n prompt=\"A watercolour fox in a snowy forest\",\n size=\"1024x1024\",\n n=1,\n)\nprint(result)\n"},{"label":"openai-node","lang":"javascript","source":"import OpenAI from \"openai\";\n\nconst client = new OpenAI({\n apiKey: process.env.NAGA_API_KEY,\n baseURL: \"https://api.naga.ac/v1\",\n});\n\nconst result = await client.images.generate({\n model: \"openai/gpt-image-2.5-sunburst-2026-09-08\",\n prompt: \"A watercolour fox in a snowy forest\",\n size: \"1024x1024\",\n n: 1,\n});\nconsole.log(result);\n"}],"requestExampleLanguages":["python","javascript","bash","go"],"requiredOnlyExamples":true,"requestExampleType":"codeSamples","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.model":"openai/gpt-image-2.5-sunburst-2026-09-08","body.prompt":"A watercolour fox in a snowy forest","body.size.oneOf.0":"1024x1024","body.n.oneOf.0":1}],"urlDisplay":"full"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"The request body of `POST /v1/images/generations`.","required":["model","prompt"],"properties":{"model":{"type":"string","description":"The model to generate with, named by its id or alias.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"prompt":{"type":"string","description":"What to generate, in words. One to 8192 characters, and moderation screens it first.","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"},"models":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"models.oneOf.0.items.[INDEX]","typeLabel":"string"},"description":"Fallback models, tried in order when `model` cannot answer: none of its providers served it, or the request does not fit it. At most 3, and only the model that answered is billed. A NagaAI extension in OpenRouter's shape.","maxItems":3,"uniqueKey":"models.oneOf.0","typeLabel":"string[]"},{"type":"null","items":{"type":"string"},"description":"Fallback models, tried in order when `model` cannot answer: none of its providers served it, or the request does not fit it. At most 3, and only the model that answered is billed. A NagaAI extension in OpenRouter's shape.","maxItems":3,"uniqueKey":"models.oneOf.1","typeLabel":"null"}],"uniqueKey":"models","typeLabel":"string[] | null"},"routing":{"type":"object","description":"How NagaAI picks the providers for this request: `max_price` removes the dearer ones and can fail the request. Takes no `strategy`. A NagaAI extension.","properties":{"max_price":{"type":"object","description":"The most one unit of each named meter may cost. Absent: no price limit.","example":{"output_token":"0.000005"},"properties":{"token":{"oneOf":[{"type":"string","description":"Credits per token, either direction, without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per token, either direction, without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.token","typeLabel":"string | number"},"input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_token","typeLabel":"string | number"},"output_token":{"oneOf":[{"type":"string","description":"Credits per output token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output token without a meter of its own. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_token","typeLabel":"string | number"},"cached_input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token read from cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cached_input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token read from cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cached_input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.cached_input_token","typeLabel":"string | number"},"cache_write_input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token written to cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token written to cache. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.cache_write_input_token","typeLabel":"string | number"},"cache_write_1h_input_token":{"oneOf":[{"type":"string","description":"Credits per prompt token cached for one hour. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_1h_input_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt token cached for one hour. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.cache_write_1h_input_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.cache_write_1h_input_token","typeLabel":"string | number"},"input_text_token":{"oneOf":[{"type":"string","description":"Credits per prompt text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per prompt text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_text_token","typeLabel":"string | number"},"output_text_token":{"oneOf":[{"type":"string","description":"Credits per output text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output text token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_text_token","typeLabel":"string | number"},"input_audio_token":{"oneOf":[{"type":"string","description":"Credits per input audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per input audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_audio_token","typeLabel":"string | number"},"output_audio_token":{"oneOf":[{"type":"string","description":"Credits per output audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output audio token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_audio_token","typeLabel":"string | number"},"input_image_token":{"oneOf":[{"type":"string","description":"Credits per input image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_image_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per input image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_image_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_image_token","typeLabel":"string | number"},"output_image_token":{"oneOf":[{"type":"string","description":"Credits per output image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_token.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output image token. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_token.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_image_token","typeLabel":"string | number"},"input_audio_hour":{"oneOf":[{"type":"string","description":"Credits per hour of input audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_hour.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per hour of input audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_audio_hour.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_audio_hour","typeLabel":"string | number"},"output_audio_hour":{"oneOf":[{"type":"string","description":"Credits per hour of output audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_hour.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per hour of output audio. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_audio_hour.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_audio_hour","typeLabel":"string | number"},"input_text_character":{"oneOf":[{"type":"string","description":"Credits per input text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_character.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per input text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_character.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_text_character","typeLabel":"string | number"},"output_text_character":{"oneOf":[{"type":"string","description":"Credits per output text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_character.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per output text character. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_text_character.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_text_character","typeLabel":"string | number"},"input_text_search":{"oneOf":[{"type":"string","description":"Credits per rerank search. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_search.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per rerank search. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.input_text_search.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.input_text_search","typeLabel":"string | number"},"output_image_image":{"oneOf":[{"type":"string","description":"Credits per delivered picture. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_image.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per delivered picture. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_image_image.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_image_image","typeLabel":"string | number"},"request":{"oneOf":[{"type":"string","description":"Credits per request: the fee a request pays once. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.request.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per request: the fee a request pays once. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.request.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.request","typeLabel":"string | number"},"output_video_second":{"oneOf":[{"type":"string","description":"Credits per second of video. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_second.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per second of video. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_second.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_video_second","typeLabel":"string | number"},"output_video_megapixel_second":{"oneOf":[{"type":"string","description":"Credits per megapixel-second of video an upscale model returns. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_megapixel_second.oneOf.0","typeLabel":"string"},{"type":"number","description":"Credits per megapixel-second of video an upscale model returns. A non-negative decimal, as a string or a number.","minimum":0,"uniqueKey":"routing.max_price.output_video_megapixel_second.oneOf.1","typeLabel":"number"}],"uniqueKey":"routing.max_price.output_video_megapixel_second","typeLabel":"string | number"}},"additionalProperties":false,"uniqueKey":"routing.max_price","typeLabel":"object"},"precision":{"type":"array","items":{"type":"string","description":"A weight precision a provider serves a model in, as it publishes it.","enum":["int4","int8","fp4","mxfp4","nvfp4","fp6","fp8","mxfp8","fp16","bf16","fp32"],"uniqueKey":"routing.precision.items.[INDEX]","typeLabel":"enum\u003cstring>"},"description":"The weight precisions the model may be served in. Absent: any.","minItems":1,"uniqueKey":"routing.precision","typeLabel":"enum\u003cstring>[]"}},"additionalProperties":false,"uniqueKey":"routing","typeLabel":"object"},"quality":{"oneOf":[{"type":"string","description":"The provider's quality knob, passed through unchecked. A provider without one drops it.","uniqueKey":"quality.oneOf.0","typeLabel":"string"},{"type":"null","description":"The provider's quality knob, passed through unchecked. A provider without one drops it.","uniqueKey":"quality.oneOf.1","typeLabel":"null"}],"uniqueKey":"quality","typeLabel":"string | null"},"size":{"oneOf":[{"type":"string","description":"The requested image size, written `{width}x{height}`; any other shape draws a refusal.","uniqueKey":"size.oneOf.0","typeLabel":"string"},{"type":"null","description":"The requested image size, written `{width}x{height}`; any other shape draws a refusal.","uniqueKey":"size.oneOf.1","typeLabel":"null"}],"uniqueKey":"size","typeLabel":"string | null"},"n":{"oneOf":[{"type":"integer","format":"int64","description":"How many images to ask for. Absent means one; a value above what the model declares draws a refusal.","uniqueKey":"n.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many images to ask for. Absent means one; a value above what the model declares draws a refusal.","uniqueKey":"n.oneOf.1","typeLabel":"null"}],"uniqueKey":"n","typeLabel":"integer\u003cint64> | null"},"response_format":{"type":"string","description":"Whether each image comes back as a link (`url`) or as inline base64 (`b64_json`).","default":"url","enum":["url","b64_json"],"uniqueKey":"response_format","typeLabel":"enum\u003cstring>"},"stream":{"oneOf":[{"type":"boolean","description":"Whether the answer comes as server-sent events instead of one JSON body: one `image_generation.completed` event per image, carrying it as base64 whatever `response_format` says.","uniqueKey":"stream.oneOf.0","typeLabel":"boolean"},{"type":"null","description":"Whether the answer comes as server-sent events instead of one JSON body: one `image_generation.completed` event per image, carrying it as base64 whatever `response_format` says.","uniqueKey":"stream.oneOf.1","typeLabel":"null"}],"uniqueKey":"stream","typeLabel":"boolean | null"},"partial_images":{"oneOf":[{"type":"integer","format":"int64","description":"How many partial images to stream before the final one, 0 to 3, with `stream` only. As OpenAI documents, fewer may arrive than asked; NagaAI sends the final image as soon as the provider finishes, without partials.","uniqueKey":"partial_images.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many partial images to stream before the final one, 0 to 3, with `stream` only. As OpenAI documents, fewer may arrive than asked; NagaAI sends the final image as soon as the provider finishes, without partials.","uniqueKey":"partial_images.oneOf.1","typeLabel":"null"}],"uniqueKey":"partial_images","typeLabel":"integer\u003cint64> | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","summary":"One image from a prompt","value":{"model":"openai/gpt-image-2.5-sunburst-2026-09-08","prompt":"A watercolour fox in a snowy forest","size":"1024x1024","n":1}}},"exampleType":"examples"}},"required":true,"exampleType":"examples"},"responses":{"90740a13-0281-4f6f-afc3-38099ba19fee":{"description":"The produced images. Each entry of `data` carries either a link the gateway hosts or the bytes inline, whichever `response_format` asked for. `usage` carries the count the charge was computed from. With `stream`, `text/event-stream` carries one `image_generation.completed` event per image instead, `usage` on the last.","content":{"application/json":{"schema":{"type":"object","description":"The body both image routes answer with.","required":["created","data","usage"],"properties":{"created":{"type":"integer","format":"int64","description":"When the gateway rendered this body, in seconds since the Unix epoch.","isRequired":true,"uniqueKey":"created","typeLabel":"integer\u003cint64>"},"data":{"type":"array","items":{"type":"object","description":"One produced image; exactly one of the two fields is filled.","properties":{"url":{"oneOf":[{"type":"string","description":"A link to the image, hosted by NagaAI rather than by the provider. The file is deleted 24 hours after it is created.","uniqueKey":"data.items.[INDEX].url.oneOf.0","typeLabel":"string"},{"type":"null","description":"A link to the image, hosted by NagaAI rather than by the provider. The file is deleted 24 hours after it is created.","uniqueKey":"data.items.[INDEX].url.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.items.[INDEX].url","typeLabel":"string | null"},"b64_json":{"oneOf":[{"type":"string","description":"The image bytes themselves, standard base64. This branch stores nothing.","uniqueKey":"data.items.[INDEX].b64_json.oneOf.0","typeLabel":"string"},{"type":"null","description":"The image bytes themselves, standard base64. This branch stores nothing.","uniqueKey":"data.items.[INDEX].b64_json.oneOf.1","typeLabel":"null"}],"uniqueKey":"data.items.[INDEX].b64_json","typeLabel":"string | null"}},"uniqueKey":"data.items.[INDEX]","typeLabel":"object"},"description":"The produced images, in the order the provider returned them.","isRequired":true,"uniqueKey":"data","typeLabel":"object[]"},"usage":{"type":"object","description":"What the gateway metered, filling in where the provider reported nothing.","required":["output_tokens","total_tokens"],"properties":{"output_tokens":{"type":"integer","format":"int64","description":"Output tokens charged for the produced images. Where the provider counted none, each image counts as its model's published output-token count for its resolution, or 2048 when the model publishes none.","isRequired":true,"uniqueKey":"usage.output_tokens","typeLabel":"integer\u003cint64>"},"total_tokens":{"type":"integer","format":"int64","description":"The sum of `input_tokens` and `output_tokens`.","isRequired":true,"uniqueKey":"usage.total_tokens","typeLabel":"integer\u003cint64>"},"input_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"Input tokens charged for. Zero on a model that prices no input text token.","uniqueKey":"usage.input_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Input tokens charged for. Zero on a model that prices no input text token.","uniqueKey":"usage.input_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"usage.input_tokens","typeLabel":"integer\u003cint64> | null"}},"isRequired":true,"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","summary":"One rendered image, as a link","value":{"created":1774000000,"data":[{"url":"https://cdn.naga.ac/images/9f2c4a1b.png"}],"usage":{"input_tokens":12,"output_tokens":1024,"total_tokens":1036}}}},"exampleType":"examples"},"text/event-stream":{"schema":{"type":"object","description":"One event of a streamed `POST /v1/images/generations`: a finished image.","required":["type","b64_json","created_at","size","quality","background","output_format"],"properties":{"type":{"type":"string","description":"Always `image_generation.completed`.","enum":["image_generation.completed"],"isRequired":true,"uniqueKey":"type","typeLabel":"enum\u003cstring>"},"b64_json":{"type":"string","description":"The image bytes, standard base64.","isRequired":true,"uniqueKey":"b64_json","typeLabel":"string"},"created_at":{"type":"integer","format":"int64","description":"When the gateway rendered the image, in seconds since the Unix epoch.","isRequired":true,"uniqueKey":"created_at","typeLabel":"integer\u003cint64>"},"size":{"type":"string","description":"The size the request asked for, or `auto` when it named none.","isRequired":true,"uniqueKey":"size","typeLabel":"string"},"quality":{"type":"string","description":"The quality the request asked for, or `auto` when it named none.","isRequired":true,"uniqueKey":"quality","typeLabel":"string"},"background":{"type":"string","description":"Always `auto`: the request takes no background, so the provider chose it.","isRequired":true,"uniqueKey":"background","typeLabel":"string"},"output_format":{"type":"string","description":"The format of the image bytes as they arrived: `png`, `jpeg` or `webp`.","isRequired":true,"uniqueKey":"output_format","typeLabel":"string"},"usage":{"oneOf":[{"type":"object","description":"What the gateway metered for the whole request, on the last image's event only.","required":["output_tokens","total_tokens"],"properties":{"output_tokens":{"type":"integer","format":"int64","description":"Output tokens charged for the produced images. Where the provider counted none, each image counts as its model's published output-token count for its resolution, or 2048 when the model publishes none.","isRequired":true,"uniqueKey":"usage.oneOf.0.output_tokens","typeLabel":"integer\u003cint64>"},"total_tokens":{"type":"integer","format":"int64","description":"The sum of `input_tokens` and `output_tokens`.","isRequired":true,"uniqueKey":"usage.oneOf.0.total_tokens","typeLabel":"integer\u003cint64>"},"input_tokens":{"oneOf":[{"type":"integer","format":"int64","description":"Input tokens charged for. Zero on a model that prices no input text token.","uniqueKey":"usage.oneOf.0.input_tokens.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"Input tokens charged for. Zero on a model that prices no input text token.","uniqueKey":"usage.oneOf.0.input_tokens.oneOf.1","typeLabel":"null"}],"uniqueKey":"usage.oneOf.0.input_tokens","typeLabel":"integer\u003cint64> | null"}},"uniqueKey":"usage.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"usage.oneOf.1","typeLabel":"null"}],"uniqueKey":"usage","typeLabel":"object | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"type":"image_generation.completed","b64_json":"\u003cstring>","created_at":123,"size":"\u003cstring>","quality":"\u003cstring>","background":"\u003cstring>","output_format":"\u003cstring>","usage":{"output_tokens":123,"total_tokens":123,"input_tokens":123}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"examples"},"c68c5b9d-404b-4a03-a39b-ccb8219beefc":{"description":"The request is malformed: a field failed its constraint, the body is not valid JSON, the model name is unknown, or no provider serves it within its price limit.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}`—the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"8b958a16-e524-4210-9470-8b20d65ff830":{"description":"The API key is missing, malformed, disabled, or does not belong to an account that may call this route.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}`—the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"invalid-api-key":{"title":"invalid-api-key","summary":"401—the key is not one this gateway serves","value":{"error":{"type":"invalid_api_key","message":"The provided API key is invalid. Please ensure your API key is correct and active. You can find more information about obtaining a key on our website: https://naga.ac If you just created this key, wait a few minutes and try again."}}}},"exampleType":"examples"}},"x-retry-safe":false,"exampleType":"examples"},"ac231fb5-c463-41c1-b2e7-c4887d309ae5":{"description":"The account has run out of credits. Top up the balance and retry.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}`—the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"insufficient-credits":{"title":"insufficient-credits","summary":"402—the account has no credits left","value":{"error":{"type":"insufficient_quota","message":"More credits required to process this request. Visit https://naga.ac/dashboard/credits to add credits."}}}},"exampleType":"examples"}},"x-retry-safe":false,"exampleType":"examples"},"a87f8ed2-7a0c-49a8-baf9-211b0f8cce1b":{"description":"The model policy of the organization or of the key's workspace does not allow this model, a spending limit is reached, or the content was blocked by the moderation policy.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}`—the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"8bce2f1c-4758-4834-ac9c-e734c419b92e":{"description":"The request body did not finish arriving within 15 minutes, or stalled for 60 seconds.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}`—the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"},"072eae1f-b6fa-41e0-9841-3260c0a70b8a":{"description":"The model is deprecated and no longer served. Pick a current one.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}`—the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"86660ad4-c4d4-4efc-98bb-466f19a4a3b8":{"description":"The request body is larger than the 32 MiB this gateway accepts.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}`—the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"94451ba6-ccb4-4e8f-8717-ac5fca5b5233":{"description":"The request was understood but its usage could not be metered, so it was not served.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}`—the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"ce6f1742-454e-4260-8813-358225d0ce70":{"description":"The account exceeded its rate limit. `Retry-After` carries the wait in seconds.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"How long to wait before retrying, in seconds."}},"content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}`—the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"rate-limited":{"title":"rate-limited","summary":"429—too many requests; `Retry-After` carries the wait","value":{"error":{"type":"rate_limit_exceeded","message":"Free model limit reached (100 requests per day and 10 per minute). Try again in 3s, or add credits at https://naga.ac/dashboard/credits to use paid models, which have no request limit."}}}},"exampleType":"examples"}},"x-retry-safe":true,"exampleType":"examples"},"b7c26289-00a4-4d1b-8536-99e901eb4730":{"description":"The gateway failed for a reason of its own. Report it—this status marks NagaAI's own bugs, never an upstream verdict.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}`—the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"},"9554d7ff-38cc-414c-8d40-8c4176006e89":{"description":"No upstream is available, or the gateway is shedding load. `Retry-After` carries the suggested wait.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"How long to wait before retrying, in seconds."}},"content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}`—the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"}},"security":{"6a1217b6-bfc0-4576-8bed-cf72b5696479":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","scopes":[],"schemeName":"bearerAuth"}},"0802e71b-7a4c-473d-baa7-c2335a1b2851":{"xApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","scopes":[],"schemeName":"xApiKeyAuth"}}},"servers":{"1d29b2f5-fc23-4c48-8460-8fa16335ed52":{"url":"https://api.naga.ac","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","scopes":[],"schemeName":"xApiKeyAuth"},"schema":{"title":"x-api-key","type":"string","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"xApiKeyAuth","name":"x-api-key"}],"title":"xApiKeyAuth"}]},"originalFileLocation":"openapi/naga-api.json"},"subdomain":"nagaai-60f8697b","siteName":"NagaAI Documentation","title":"Create an image - NagaAI Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-22T20:09:58.095Z","originalFileLocation":"api-reference/images/create-an-image.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Creates images from a text prompt and charges the account for what it counted. Requires an API key. /v1/images/edits changes images that were uploaded instead. A result that takes over 60 seconds arrives with status 200, and a failure then as an error object in the body. See Errors.\">\u003cmeta data-mint-head name=\"application-name\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/DEFPeHeWiHg6D1M5/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/DEFPeHeWiHg6D1M5/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/DEFPeHeWiHg6D1M5/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/DEFPeHeWiHg6D1M5/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/DEFPeHeWiHg6D1M5/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/DEFPeHeWiHg6D1M5/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/DEFPeHeWiHg6D1M5/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/DEFPeHeWiHg6D1M5/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/DEFPeHeWiHg6D1M5/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create an image - NagaAI Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Creates images from a text prompt and charges the account for what it counted. Requires an API key. /v1/images/edits changes images that were uploaded instead. A result that takes over 60 seconds arrives with status 200, and a failure then as an error object in the body. See Errors.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.naga.ac/api-reference/images/create-an-image\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://nagaai-60f8697b.mintlify.site/_mintlify/api/og/v2?division=Images\u0026amp;title=Create+an+image\u0026amp;description=Creates+images+from+a+text+prompt+and+charges+the+account+for+what+it+counted.+Requires+an+API+key.+%60%2Fv1%2Fimages%2Fedits%60+changes+images+that+were+uploaded+instead\u0026amp;theme=9f114a48be2c729255a5955e\u0026amp;signature=dba2a23ab7fdc527895e43f9c9546153fa84e835031413dc32f0a37f41c6ac81\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create an image - NagaAI Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Creates images from a text prompt and charges the account for what it counted. Requires an API key. /v1/images/edits changes images that were uploaded instead. A result that takes over 60 seconds arrives with status 200, and a failure then as an error object in the body. See Errors.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://nagaai-60f8697b.mintlify.site/_mintlify/api/og/v2?division=Images\u0026amp;title=Create+an+image\u0026amp;description=Creates+images+from+a+text+prompt+and+charges+the+account+for+what+it+counted.+Requires+an+API+key.+%60%2Fv1%2Fimages%2Fedits%60+changes+images+that+were+uploaded+instead\u0026amp;theme=9f114a48be2c729255a5955e\u0026amp;signature=dba2a23ab7fdc527895e43f9c9546153fa84e835031413dc32f0a37f41c6ac81\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/DEFPeHeWiHg6D1M5/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5a5ae5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.naga.ac/api-reference/images/create-an-image\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/images/create-an-image.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.naga.ac/#organization\",\"name\":\"NagaAI Documentation\",\"url\":\"https://docs.naga.ac\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/nagaai-60f8697b/iT26S8z0rCJNbf-r/static/img/logo-light.svg?fit=max\u0026auto=format\u0026n=iT26S8z0rCJNbf-r\u0026q=85\u0026s=7ad6a12d817d2e7ffb3c1296111448f0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.naga.ac#website\",\"name\":\"NagaAI Documentation\",\"url\":\"https://docs.naga.ac\",\"publisher\":{\"@id\":\"https://docs.naga.ac/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.naga.ac/api-reference/images/create-an-image#webpage\",\"url\":\"https://docs.naga.ac/api-reference/images/create-an-image\",\"name\":\"Create an image\",\"description\":\"Creates images from a text prompt and charges the account for what it counted. Requires an API key. /v1/images/edits changes images that were uploaded instead. A result that takes over 60 seconds arrives with status 200, and a failure then as an error object in the body. See Errors.\",\"dateModified\":\"2026-11-22T20:09:58.095Z\",\"isPartOf\":{\"@id\":\"https://docs.naga.ac#website\"},\"breadcrumb\":{\"@id\":\"https://docs.naga.ac/api-reference/images/create-an-image#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.naga.ac/api-reference/images/create-an-image#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.naga.ac/api-reference/responses/create-a-response\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create an image\",\"item\":\"https://docs.naga.ac/api-reference/images/create-an-image\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.naga.ac/api-reference/images/create-an-image#apireference\",\"headline\":\"Create an image\",\"name\":\"Create an image\",\"description\":\"Creates images from a text prompt and charges the account for what it counted. Requires an API key. /v1/images/edits changes images that were uploaded instead. A result that takes over 60 seconds arrives with status 200, and a failure then as an error object in the body. See Errors.\",\"url\":\"https://docs.naga.ac/api-reference/images/create-an-image\",\"mainEntityOfPage\":{\"@id\":\"https://docs.naga.ac/api-reference/images/create-an-image#webpage\"},\"dateModified\":\"2026-11-22T20:09:58.095Z\",\"publisher\":{\"@id\":\"https://docs.naga.ac/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.naga.ac#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"NagaAI Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"NagaAI Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/images/create-an-image.md","siteName":"NagaAI Documentation","nav":{"global":null,"tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":""}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"API reference","sidebarTitle":"Overview","icon":"book","href":"/api-reference/overview"},{"title":"Errors","icon":"triangle-exclamation","href":"/build/error-handling"},{"title":"Limits","icon":"gauge","href":"/build/rate-limits"}]},{"group":"Objects","pages":[{"title":"The model object","sidebarTitle":"Model","icon":"cube","href":"/api-reference/model-object"},{"title":"The routing object","sidebarTitle":"Routing","icon":"route","href":"/api-reference/routing-object"}]},{"group":"Endpoints","pages":[{"group":"Responses","expanded":false,"pages":[{"title":"Create a response","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/responses","href":"/api-reference/responses/create-a-response"}]},{"group":"Chat Completions","expanded":false,"pages":[{"title":"Create a chat completion","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/chat/completions","href":"/api-reference/chat-completions/create-a-chat-completion"}]},{"group":"Messages","expanded":false,"pages":[{"title":"Create a message","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/messages","href":"/api-reference/messages/create-a-message"}]},{"group":"Models","expanded":false,"pages":[{"title":"List models","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/models","href":"/api-reference/models/list-models"}]},{"group":"Startups","expanded":false,"pages":[{"title":"List startups","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/startups","href":"/api-reference/startups/list-startups"}]},{"group":"Embeddings","expanded":false,"pages":[{"title":"Create embeddings","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/embeddings","href":"/api-reference/embeddings/create-embeddings"}]},{"group":"Moderations","expanded":false,"pages":[{"title":"Classify content","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/moderations","href":"/api-reference/moderations/classify-content"}]},{"group":"Rerank","expanded":false,"pages":[{"title":"Rerank documents","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/rerank","href":"/api-reference/rerank/rerank-documents"}]},{"group":"Audio","expanded":false,"pages":[{"title":"Create speech","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/speech","href":"/api-reference/audio/create-speech"},{"title":"Create a transcription","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/transcriptions","href":"/api-reference/audio/create-a-transcription"},{"title":"Create a translation","description":"Converts uploaded audio into English text and charges the account for what it counted. Requires an API key. `/v1/audio/transcriptions` answers in the language that was spoken. A result that takes over 60 seconds arrives with status `200`, and a failure then as an `error` object in the body. See [Errors](https://docs.naga.ac/build/error-handling#errors-in-a-slow-request).","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/translations","href":"/api-reference/audio/create-a-translation"}]},{"group":"Images","expanded":false,"pages":[{"title":"Create an image","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/images/generations","href":"/api-reference/images/create-an-image"},{"title":"Edit an image","description":"Edits uploaded images against a text prompt and charges the account for what it counted. Requires an API key. `/v1/images/generations` draws from a prompt alone. A result that takes over 60 seconds arrives with status `200`, and a failure then as an `error` object in the body. See [Errors](https://docs.naga.ac/build/error-handling#errors-in-a-slow-request).","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/images/edits","href":"/api-reference/images/edit-an-image"}]},{"group":"Videos","expanded":false,"pages":[{"title":"Create a video","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/videos","href":"/api-reference/videos/create-a-video"},{"title":"Get a video job","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/videos/{id}","href":"/api-reference/videos/get-a-video-job"},{"title":"Download a video","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/videos/{id}/content","href":"/api-reference/videos/download-a-video"}]},{"group":"Requests","expanded":false,"pages":[{"title":"Get a request","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/requests/{id}","href":"/api-reference/requests/get-a-request"}]},{"group":"Account","expanded":false,"pages":[{"title":"Get the account balance","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/balance","href":"/api-reference/account/get-the-account-balance"},{"title":"Get account activity","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/activity","href":"/api-reference/account/get-account-activity"},{"group":"API Keys","expanded":false,"pages":[{"title":"List API keys","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/keys","href":"/api-reference/api-keys/list-api-keys"},{"title":"Create an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/account/keys","href":"/api-reference/api-keys/create-an-api-key"},{"title":"Get an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/keys/{key_id}","href":"/api-reference/api-keys/get-an-api-key"},{"title":"Update an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json patch /v1/account/keys/{key_id}","href":"/api-reference/api-keys/update-an-api-key"},{"title":"Delete an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json delete /v1/account/keys/{key_id}","href":"/api-reference/api-keys/delete-an-api-key"}]}]}]}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/agents/claude-code"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Create an image - NagaAI Documentation","deploymentId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","buildId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-_HcdDqS2.js","snippetPresets-CXnm-WO6.js","utils-Dg59J__o.js","style-to-object-BY3JEAdk.js","utils-D8TRpdk7.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-B6QaxWc5.js","conditional-requirements-CFM0id0Q.js","cloneDeep-DeMZ-lcM.js","_Uint8Array-BjA2mcVW.js","isObject-FP1Yky1u.js","ApiExamples-cjPyMv63.js","usePlaygroundInputsStore-D7BWoaw4.js","shallow-Z1ceDNSG.js","isEqual-BObTuQrO.js","CodeSnippets-D1UZ1AE-.js","CodeSnippet-B373COAT.js","getApiPlaygroundDisplay-CfL-UuDS.js","Page-DuqezyvM.js","DynamicMarkdown-5yMTCLas.js","SectionHeading-BxT1HYfP.js","icon-DYJTTD3g.js","MethodPill-4AyycJeu.js","getPastedJson-Bp3WV6cN.js","Check2Icon-PhZu6Gry.js","axios-CsQoIw0U.js","Markdown-Dy9a8hT8.js","AssistantPageLink-87tSPwGm.js","dist-CXMB3QQU.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}