import base64, os
from openai import OpenAI
client = OpenAI(api_key=os.environ["SHAREMYAI_API_KEY"], base_url="https://sharemy.ai/v1")
result = client.images.generate(
model="flux2-klein",
prompt="A lighthouse at dusk",
size="512x512",
extra_body={"seed": 42}, # optional; not part of OpenAI's API
)
with open("lighthouse.png", "wb") as f:
f.write(base64.b64decode(result.data[0].b64_json))
import fs from "node:fs";
import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.SHAREMYAI_API_KEY, baseURL: "https://sharemy.ai/v1" });
const result = await client.images.generate({
model: "flux2-klein",
prompt: "A lighthouse at dusk",
size: "512x512",
});
fs.writeFileSync("lighthouse.png", Buffer.from(result.data[0].b64_json, "base64"));
{
"error": {
"message": "Choose a temperature from 0 to 2.",
"type": "invalid_request_error",
"param": "temperature",
"code": "invalid_value"
}
}
{
"error": {
"message": "Send your API token as Authorization: Bearer smai_…. Create one at https://sharemy.ai, account panel, API tokens.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}
{
"error": {
"message": "This costs 8.192 credits and your balance is 3.000 credits. Add credits at https://sharemy.ai.",
"type": "insufficient_quota",
"param": null,
"code": "insufficient_quota",
"price_credits": 8.192,
"balance_credits": 3
}
}
{
"error": {
"message": "This account is suspended. If you think that is a mistake, contact us.",
"type": "invalid_request_error",
"param": null,
"code": "account_suspended"
}
}
{
"error": {
"message": "At most 4 API calls at once. Wait for one to finish.",
"type": "invalid_request_error",
"param": null,
"code": "rate_limit_exceeded"
}
}
import base64, os
from openai import OpenAI
client = OpenAI(api_key=os.environ["SHAREMYAI_API_KEY"], base_url="https://sharemy.ai/v1")
result = client.images.generate(
model="flux2-klein",
prompt="A lighthouse at dusk",
size="512x512",
extra_body={"seed": 42}, # optional; not part of OpenAI's API
)
with open("lighthouse.png", "wb") as f:
f.write(base64.b64decode(result.data[0].b64_json))
import fs from "node:fs";
import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.SHAREMYAI_API_KEY, baseURL: "https://sharemy.ai/v1" });
const result = await client.images.generate({
model: "flux2-klein",
prompt: "A lighthouse at dusk",
size: "512x512",
});
fs.writeFileSync("lighthouse.png", Buffer.from(result.data[0].b64_json, "base64"));
{
"error": {
"message": "Choose a temperature from 0 to 2.",
"type": "invalid_request_error",
"param": "temperature",
"code": "invalid_value"
}
}
{
"error": {
"message": "Send your API token as Authorization: Bearer smai_…. Create one at https://sharemy.ai, account panel, API tokens.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}
{
"error": {
"message": "This costs 8.192 credits and your balance is 3.000 credits. Add credits at https://sharemy.ai.",
"type": "insufficient_quota",
"param": null,
"code": "insufficient_quota",
"price_credits": 8.192,
"balance_credits": 3
}
}
{
"error": {
"message": "This account is suspended. If you think that is a mistake, contact us.",
"type": "invalid_request_error",
"param": null,
"code": "account_suspended"
}
}
{
"error": {
"message": "At most 4 API calls at once. Wait for one to finish.",
"type": "invalid_request_error",
"param": null,
"code": "rate_limit_exceeded"
}
}
Makes one to four pictures from a prompt with one of the picture models. Each picture comes back as a base64-encoded PNG in data[].b64_json.Send generation fields as JSON or multipart form data. To get a job id and poll for the pictures, send Prefer: respond-async or set async to true. See Image jobs.With janus-pro-1b, each picture is a separate job. If you request several and a later job fails, the API returns HTTP 200 with the pictures already made. Check data.length to see how many you received. If the first job fails, you get its HTTP error.
Sizes
Model
Sizes
z-image-turbo (default)
256x256, 512x512 (default), 1024x1024
flux2-klein
256x256, 512x512 (default), 1024x1024
janus-pro-1b
384x384 only
Any other size is refused with 400, and the message lists the sizes the model takes.
Seeds
seed is not part of OpenAI’s API. With z-image-turbo and flux2-klein, the first picture uses seed and each further one uses the next number. Leave it out for a random seed. Each picture’s seed comes back in data[].seed.janus-pro-1b does not take a seed.With the OpenAI Python SDK, send it with extra_body={"seed": 42}.
Price
Each picture costs its model’s price at its size, so n pictures cost n times as much. See Credits and pricing.
For edits, upload a picture and mask to Edit an image. Image variations are unsupported.
Authorizations
Authorization
string
header
required
An API token from the account panel on sharemy.ai. Tokens start with smai_.
Headers
Prefer
string
Send respond-async to receive a job id and poll for the result.
Body
application/jsonmultipart/form-data
Top-level null fields are treated as omitted.
prompt
string
required
What to draw, 1 to 2,000 characters.
Required string length: 1 - 2000
model
enum<string> | null
default:z-image-turbo
Available options:
z-image-turbo,
flux2-klein,
janus-pro-1b,
null
n
integer | null
default:1
Number of pictures requested. Janus returns completed pictures if a later job fails.
Required range: 1 <= x <= 4
size
enum<string> | null
z-image-turbo and flux2-klein take 256x256, 512x512 (their default) or 1024x1024. janus-pro-1b takes only 384x384, its default.
Available options:
256x256,
512x512,
1024x1024,
384x384,
null
response_format
enum<string> | null
default:b64_json
Only b64_json. There are no image URLs.
Available options:
b64_json,
null
seed
integer | null
Not part of OpenAI's API. The seed for the first picture; each further picture uses the next number. Random when left out. janus-pro-1b does not use it.
async
booleanstring
A boolean true or the string "true" requests an async job. You can also send Prefer: respond-async.
Response
Generated pictures. A Janus request may return fewer than n if a later picture fails. The cost header totals completed pictures.
created
integer
required
Unix time in seconds.
data
object[]
required
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"ShareMyAI","description":"Use ShareMyAI's OpenAI-compatible API, and share a GPU to get paid in USDC.","colors":{"primary":"#15171A","light":"#F3F4F1","dark":"#15171A"},"logo":{"light":"https://mintcdn.com/catswithkeyboards/kHqXtUmpvZnPdsJV/logo/light.svg?fit=max\u0026auto=format\u0026n=kHqXtUmpvZnPdsJV\u0026q=85\u0026s=3a3f657776cc3d70b3de85591e337616","dark":"https://mintcdn.com/catswithkeyboards/kHqXtUmpvZnPdsJV/logo/dark.svg?fit=max\u0026auto=format\u0026n=kHqXtUmpvZnPdsJV\u0026q=85\u0026s=fea0b1db2932c9bc618cf3e6655ced9e","href":"https://sharemy.ai"},"favicon":"https://mintcdn.com/catswithkeyboards/zlAUzb7kyGL5rvHp/favicon.svg?fit=max\u0026auto=format\u0026n=zlAUzb7kyGL5rvHp\u0026q=85\u0026s=06ce9e3c0b5afba5d4913f01f0885ad5","api":{"openapi":"api-reference/openapi.json","playground":{"display":"interactive"},"examples":{"autogenerate":false}},"background":{"color":{"light":"#F3F4F1","dark":"#15171A"}},"navbar":{"links":[{"href":"https://discord.gg/qGhXEagn8K","label":"Discord"}],"primary":{"type":"button","label":"Open ShareMyAI","href":"https://sharemy.ai"}},"footer":{"socials":{"website":"https://sharemy.ai","discord":"https://discord.gg/qGhXEagn8K"}},"seo":{"metatags":{"og:site_name":"ShareMyAI docs","og:image":"https://docs.sharemy.ai/images/og.jpg","og:image:type":"image/jpeg","og:image:width":"1200","og:image:height":"630","og:image:alt":"An OpenAI-compatible API on shared graphics cards.","twitter:card":"summary_large_image","twitter:image":"https://docs.sharemy.ai/images/og.jpg","twitter:image:alt":"An OpenAI-compatible API on shared graphics cards.","theme-color":"#F3F4F1"},"indexing":"navigable"},"fonts":{"family":"Archivo"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"catswithkeyboards","hasAudioNarration":false,"actualSubdomain":"catswithkeyboards","customDomains":["docs.sharemy.ai"],"gitSource":{"type":"github","owner":"catswithkeyboards","repo":"sharemyai-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":"","_id":"6b10a5db9ffae5051c3fa445"},"entitlements":{},"buildId":"6b145dce6e4c9d2585386bce","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"default","tag":"API reference","count":18},{"language":"default","tag":"Guides","count":8},{"language":"default","tag":"Use the API","count":4},{"language":"default","tag":"Share your GPU","count":2},{"language":"default","tag":"Get started","count":2}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","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":"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":"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":"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":"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":"turbopuffer-dual-write","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":"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":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":true},"customCss":[]}
{"page":{"pagePath":"api-reference/image-generations","slug":"/api-reference/image-generations","pageMetadata":{"title":"Create images","openapi":"api-reference/openapi.json POST /v1/images/generations","description":"Make one to four pictures from a prompt with Z-Image Turbo, FLUX.2 Klein or Janus-Pro. Pictures come back as base64 PNG.","href":"/api-reference/image-generations"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Make one to four pictures from a prompt with Z-Image Turbo, FLUX.2 Klein or Janus-Pro. Pictures come back as base64 PNG.\"\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,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Table}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Makes one to four pictures from a prompt with one of the `,_jsx(_components.a,{href:`/models#pictures`,children:`picture models`}),`. Each picture comes back as a base64-encoded PNG in `,_jsx(_components.code,{children:`data[].b64_json`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Send generation fields as JSON or multipart form data. To get a job id and poll for the pictures, send `,_jsx(_components.code,{children:`Prefer: respond-async`}),` or set `,_jsx(_components.code,{children:`async`}),` to `,_jsx(_components.code,{children:`true`}),`. See `,_jsx(_components.a,{href:`/api-reference/jobs`,children:`Image jobs`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`janus-pro-1b`}),`, each picture is a separate job. If you request several and a later job fails, the API returns HTTP 200 with the pictures already made. Check `,_jsx(_components.code,{children:`data.length`}),` to see how many you received. If the first job fails, you get its HTTP error.`]}),`\n`,_jsx(Heading,{level:`2`,id:`sizes`,children:`Sizes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Model`}),_jsx(_components.th,{children:`Sizes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`z-image-turbo`}),` (default)`]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`256x256`}),`, `,_jsx(_components.code,{children:`512x512`}),` (default), `,_jsx(_components.code,{children:`1024x1024`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flux2-klein`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`256x256`}),`, `,_jsx(_components.code,{children:`512x512`}),` (default), `,_jsx(_components.code,{children:`1024x1024`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`janus-pro-1b`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`384x384`}),` only`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Any other size is refused with `,_jsx(_components.code,{children:`400`}),`, and the message lists the sizes the model takes.`]}),`\n`,_jsx(Heading,{level:`2`,id:`seeds`,children:`Seeds`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`seed`}),` is not part of OpenAI’s API. With `,_jsx(_components.code,{children:`z-image-turbo`}),` and `,_jsx(_components.code,{children:`flux2-klein`}),`, the first picture uses `,_jsx(_components.code,{children:`seed`}),` and each further one uses the next number. Leave it out for a random seed. Each picture’s seed comes back in `,_jsx(_components.code,{children:`data[].seed`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`janus-pro-1b`}),` does not take a seed.`]}),`\n`,_jsxs(_components.p,{children:[`With the OpenAI Python SDK, send it with `,_jsx(_components.code,{children:`extra_body={\"seed\": 42}`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`price`,children:`Price`}),`\n`,_jsxs(_components.p,{children:[`Each picture costs its model’s price at its size, so `,_jsx(_components.code,{children:`n`}),` pictures cost `,_jsx(_components.code,{children:`n`}),` times as much. See `,_jsx(_components.a,{href:`/credits-and-pricing#pictures`,children:`Credits and pricing`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`differences-from-openai`,children:`Differences from OpenAI`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`response_format`}),`:`]}),` only `,_jsx(_components.code,{children:`b64_json`}),`. `,_jsx(_components.code,{children:`url`}),` is refused.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`size`}),`:`]}),` square sizes only, from the table above.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Ignored:`}),` `,_jsx(_components.code,{children:`quality`}),`, `,_jsx(_components.code,{children:`style`}),`, `,_jsx(_components.code,{children:`background`}),`, `,_jsx(_components.code,{children:`output_format`}),`, `,_jsx(_components.code,{children:`moderation`}),`, `,_jsx(_components.code,{children:`user`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`revised_prompt`})}),` is always `,_jsx(_components.code,{children:`null`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`For edits, upload a picture and mask to `,_jsx(_components.a,{href:`/api-reference/image-edits`,children:`Edit an image`}),`. Image variations are unsupported.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create images","openapi":"api-reference/openapi.json POST /v1/images/generations","description":"Make one to four pictures from a prompt with Z-Image Turbo, FLUX.2 Klein or Janus-Pro. Pictures come back as base64 PNG.","href":"/api-reference/image-generations"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Sizes","slug":"sizes","depth":2,"children":[]},{"title":"Seeds","slug":"seeds","depth":2,"children":[]},{"title":"Price","slug":"price","depth":2,"children":[]},{"title":"Differences from OpenAI","slug":"differences-from-openai","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createImage","tags":["Images"],"summary":"Create images","description":"Make one to four pictures from a prompt with Z-Image Turbo, FLUX.2 Klein or Janus-Pro. Pictures come back as base64 PNG.","requestBody":"dd444dde-ac81-4a31-a143-237cc322b377","responses":{"200":"3d885a87-f735-485c-96fd-e105efd753df","202":"883a53c2-4ef0-43a1-adbd-bcebddc769e4","400":"7df29c50-706c-4d7c-b797-9f8c0a8457bb","401":"d24cc0b7-f675-4adb-a7b8-e28f0c1fbb06","402":"681e5d55-d320-48a4-9d9a-eb1aa85e6875","403":"771e4189-cc9e-448c-b90b-fe2adb061177","405":"67fc502c-18ed-45c6-ad27-ef9e8088f046","429":"36d31969-d4cf-407c-a24d-969048baefa1","499":"6d4022a6-442f-4fc6-ae3a-2aa823975af9","502":"b5d64c3b-cc3f-4667-9d92-9569ad2e0110","503":"28a981ea-18ce-4fb7-8d20-8c2482a2764f"},"x-codeSamples":[{"lang":"bash","label":"curl","source":"curl https://sharemy.ai/v1/images/generations \\\n -H \"Authorization: Bearer $SHAREMYAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"model\": \"flux2-klein\", \"prompt\": \"A lighthouse at dusk\", \"size\": \"512x512\"}' \\\n | jq -r '.data[0].b64_json' | base64 --decode > lighthouse.png"},{"lang":"python","label":"Python","source":"import base64, os\nfrom openai import OpenAI\n\nclient = OpenAI(api_key=os.environ[\"SHAREMYAI_API_KEY\"], base_url=\"https://sharemy.ai/v1\")\n\nresult = client.images.generate(\n model=\"flux2-klein\",\n prompt=\"A lighthouse at dusk\",\n size=\"512x512\",\n extra_body={\"seed\": 42}, # optional; not part of OpenAI's API\n)\nwith open(\"lighthouse.png\", \"wb\") as f:\n f.write(base64.b64decode(result.data[0].b64_json))"},{"lang":"javascript","label":"Node","source":"import fs from \"node:fs\";\nimport OpenAI from \"openai\";\n\nconst client = new OpenAI({ apiKey: process.env.SHAREMYAI_API_KEY, baseURL: \"https://sharemy.ai/v1\" });\n\nconst result = await client.images.generate({\n model: \"flux2-klein\",\n prompt: \"A lighthouse at dusk\",\n size: \"512x512\",\n});\nfs.writeFileSync(\"lighthouse.png\", Buffer.from(result.data[0].b64_json, \"base64\"));"}],"parameters":["6287368d-0e80-44a3-8f77-96337327ea07"],"method":"post","type":"path","servers":["7c2efbf2-420a-42c5-bf21-35c4f72785c6"],"security":["71b12b07-8dbf-4305-a126-1d5ec1931f4f"],"path":"/v1/images/generations","baseUrlOptions":["https://sharemy.ai"],"title":"Create images","codeSamples":[{"label":"curl","lang":"bash","source":"curl https://sharemy.ai/v1/images/generations \\\n -H \"Authorization: Bearer $SHAREMYAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"model\": \"flux2-klein\", \"prompt\": \"A lighthouse at dusk\", \"size\": \"512x512\"}' \\\n | jq -r '.data[0].b64_json' | base64 --decode > lighthouse.png"},{"label":"Python","lang":"python","source":"import base64, os\nfrom openai import OpenAI\n\nclient = OpenAI(api_key=os.environ[\"SHAREMYAI_API_KEY\"], base_url=\"https://sharemy.ai/v1\")\n\nresult = client.images.generate(\n model=\"flux2-klein\",\n prompt=\"A lighthouse at dusk\",\n size=\"512x512\",\n extra_body={\"seed\": 42}, # optional; not part of OpenAI's API\n)\nwith open(\"lighthouse.png\", \"wb\") as f:\n f.write(base64.b64decode(result.data[0].b64_json))"},{"label":"Node","lang":"javascript","source":"import fs from \"node:fs\";\nimport OpenAI from \"openai\";\n\nconst client = new OpenAI({ apiKey: process.env.SHAREMYAI_API_KEY, baseURL: \"https://sharemy.ai/v1\" });\n\nconst result = await client.images.generate({\n model: \"flux2-klein\",\n prompt: \"A lighthouse at dusk\",\n size: \"512x512\",\n});\nfs.writeFileSync(\"lighthouse.png\", Buffer.from(result.data[0].b64_json, \"base64\"));"}],"requiredOnlyExamples":false,"disableCodeSampleGeneration":true,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"6287368d-0e80-44a3-8f77-96337327ea07":{"name":"Prefer","in":"header","description":"Send respond-async to receive a job id and poll for the result.","schema":{"type":"string","description":"Send respond-async to receive a job id and poll for the result.","uniqueKey":"","typeLabel":"string"},"example":"respond-async"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000,"description":"What to draw, 1 to 2,000 characters.","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"},"model":{"oneOf":[{"type":"string","enum":["z-image-turbo","flux2-klein","janus-pro-1b",null],"default":"z-image-turbo","uniqueKey":"model.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["z-image-turbo","flux2-klein","janus-pro-1b",null],"default":"z-image-turbo","uniqueKey":"model.oneOf.1","typeLabel":"null"}],"uniqueKey":"model","typeLabel":"enum\u003cstring> | null"},"n":{"oneOf":[{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"Number of pictures requested. Janus returns completed pictures if a later job fails.","uniqueKey":"n.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":4,"default":1,"description":"Number of pictures requested. Janus returns completed pictures if a later job fails.","uniqueKey":"n.oneOf.1","typeLabel":"null"}],"uniqueKey":"n","typeLabel":"integer | null"},"size":{"oneOf":[{"type":"string","enum":["256x256","512x512","1024x1024","384x384",null],"description":"`z-image-turbo` and `flux2-klein` take 256x256, 512x512 (their default) or 1024x1024. `janus-pro-1b` takes only 384x384, its default.","uniqueKey":"size.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["256x256","512x512","1024x1024","384x384",null],"description":"`z-image-turbo` and `flux2-klein` take 256x256, 512x512 (their default) or 1024x1024. `janus-pro-1b` takes only 384x384, its default.","uniqueKey":"size.oneOf.1","typeLabel":"null"}],"uniqueKey":"size","typeLabel":"enum\u003cstring> | null"},"response_format":{"oneOf":[{"type":"string","enum":["b64_json",null],"default":"b64_json","description":"Only `b64_json`. There are no image URLs.","uniqueKey":"response_format.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["b64_json",null],"default":"b64_json","description":"Only `b64_json`. There are no image URLs.","uniqueKey":"response_format.oneOf.1","typeLabel":"null"}],"uniqueKey":"response_format","typeLabel":"enum\u003cstring> | null"},"seed":{"oneOf":[{"type":"integer","description":"Not part of OpenAI's API. The seed for the first picture; each further picture uses the next number. Random when left out. `janus-pro-1b` does not use it.","uniqueKey":"seed.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Not part of OpenAI's API. The seed for the first picture; each further picture uses the next number. Random when left out. `janus-pro-1b` does not use it.","uniqueKey":"seed.oneOf.1","typeLabel":"null"}],"uniqueKey":"seed","typeLabel":"integer | null"},"async":{"oneOf":[{"type":"boolean","description":"A boolean true or the string \"true\" requests an async job. You can also send Prefer: respond-async.","uniqueKey":"async.oneOf.0","typeLabel":"boolean"},{"type":"string","description":"A boolean true or the string \"true\" requests an async job. You can also send Prefer: respond-async.","uniqueKey":"async.oneOf.1","typeLabel":"string"},{"type":"null","description":"A boolean true or the string \"true\" requests an async job. You can also send Prefer: respond-async.","uniqueKey":"async.oneOf.2","typeLabel":"null"}],"uniqueKey":"async","typeLabel":"boolean | string | null"}},"description":"Top-level null fields are treated as omitted.","uniqueKey":"","typeLabel":"object"},"example":{"model":"flux2-klein","prompt":"A lighthouse at dusk","size":"512x512","n":1},"examples":{"Example":{"title":"Example","value":{"model":"flux2-klein","prompt":"A lighthouse at dusk","size":"512x512","n":1}}},"exampleType":"examples"},"multipart/form-data":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000,"description":"What to draw, 1 to 2,000 characters.","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"},"model":{"oneOf":[{"type":"string","enum":["z-image-turbo","flux2-klein","janus-pro-1b",null],"default":"z-image-turbo","uniqueKey":"model.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["z-image-turbo","flux2-klein","janus-pro-1b",null],"default":"z-image-turbo","uniqueKey":"model.oneOf.1","typeLabel":"null"}],"uniqueKey":"model","typeLabel":"enum\u003cstring> | null"},"n":{"oneOf":[{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"Number of pictures requested. Janus returns completed pictures if a later job fails.","uniqueKey":"n.oneOf.0","typeLabel":"integer"},{"type":"null","minimum":1,"maximum":4,"default":1,"description":"Number of pictures requested. Janus returns completed pictures if a later job fails.","uniqueKey":"n.oneOf.1","typeLabel":"null"}],"uniqueKey":"n","typeLabel":"integer | null"},"size":{"oneOf":[{"type":"string","enum":["256x256","512x512","1024x1024","384x384",null],"description":"`z-image-turbo` and `flux2-klein` take 256x256, 512x512 (their default) or 1024x1024. `janus-pro-1b` takes only 384x384, its default.","uniqueKey":"size.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["256x256","512x512","1024x1024","384x384",null],"description":"`z-image-turbo` and `flux2-klein` take 256x256, 512x512 (their default) or 1024x1024. `janus-pro-1b` takes only 384x384, its default.","uniqueKey":"size.oneOf.1","typeLabel":"null"}],"uniqueKey":"size","typeLabel":"enum\u003cstring> | null"},"response_format":{"oneOf":[{"type":"string","enum":["b64_json",null],"default":"b64_json","description":"Only `b64_json`. There are no image URLs.","uniqueKey":"response_format.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["b64_json",null],"default":"b64_json","description":"Only `b64_json`. There are no image URLs.","uniqueKey":"response_format.oneOf.1","typeLabel":"null"}],"uniqueKey":"response_format","typeLabel":"enum\u003cstring> | null"},"seed":{"oneOf":[{"type":"integer","description":"Not part of OpenAI's API. The seed for the first picture; each further picture uses the next number. Random when left out. `janus-pro-1b` does not use it.","uniqueKey":"seed.oneOf.0","typeLabel":"integer"},{"type":"null","description":"Not part of OpenAI's API. The seed for the first picture; each further picture uses the next number. Random when left out. `janus-pro-1b` does not use it.","uniqueKey":"seed.oneOf.1","typeLabel":"null"}],"uniqueKey":"seed","typeLabel":"integer | null"},"async":{"oneOf":[{"type":"boolean","description":"A boolean true or the string \"true\" requests an async job. You can also send Prefer: respond-async.","uniqueKey":"async.oneOf.0","typeLabel":"boolean"},{"type":"string","description":"A boolean true or the string \"true\" requests an async job. You can also send Prefer: respond-async.","uniqueKey":"async.oneOf.1","typeLabel":"string"},{"type":"null","description":"A boolean true or the string \"true\" requests an async job. You can also send Prefer: respond-async.","uniqueKey":"async.oneOf.2","typeLabel":"null"}],"uniqueKey":"async","typeLabel":"boolean | string | null"}},"description":"Top-level null fields are treated as omitted.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"prompt":"\u003cstring>","model":"z-image-turbo","n":1,"response_format":"b64_json","seed":123,"async":true}}},"exampleType":"generated"}},"exampleType":"examples"},"responses":{"3d885a87-f735-485c-96fd-e105efd753df":{"description":"Generated pictures. A Janus request may return fewer than n if a later picture fails. The cost header totals completed pictures.","content":{"application/json":{"schema":{"type":"object","required":["created","data"],"properties":{"created":{"type":"integer","description":"Unix time in seconds.","isRequired":true,"uniqueKey":"created","typeLabel":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"b64_json":{"type":"string","description":"A PNG file, base64-encoded.","isRequired":true,"uniqueKey":"data.items.[INDEX].b64_json","typeLabel":"string"},"revised_prompt":{"type":"null","description":"Always null: prompts are used as sent.","isRequired":true,"uniqueKey":"data.items.[INDEX].revised_prompt","typeLabel":"null"},"seed":{"oneOf":[{"type":"integer","description":"The seed the picture was drawn with, when the model reports one.","isRequired":true,"uniqueKey":"data.items.[INDEX].seed.oneOf.0","typeLabel":"integer"},{"type":"null","description":"The seed the picture was drawn with, when the model reports one.","isRequired":true,"uniqueKey":"data.items.[INDEX].seed.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.items.[INDEX].seed","typeLabel":"integer | null"}},"required":["b64_json","revised_prompt","seed"],"uniqueKey":"data.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"data","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"created":123,"data":[{"b64_json":"\u003cstring>","revised_prompt":null,"seed":123}]}}},"exampleType":"generated"}},"headers":{"x-request-id":{"description":"Identifier for this API response.","schema":{"type":"string"}},"x-ratelimit-limit-concurrent":{"description":"Job slots per account across all tokens.","schema":{"type":"integer","const":4}},"x-ratelimit-remaining-concurrent":{"description":"Free account slots when headers are sent.","schema":{"type":"integer","minimum":0,"maximum":4}},"X-ShareMyAI-Cost-Credits":{"description":"Quoted price in credits when a job was accepted. For a Janus batch, the total for completed pictures.","schema":{"type":"number"}},"X-ShareMyAI-Balance-Credits":{"description":"Balance in credits after the hold, from the last successful quote on a Janus batch.","schema":{"type":"number"}}},"exampleType":"generated"},"883a53c2-4ef0-43a1-adbd-bcebddc769e4":{"description":"Queued for background execution. Wait for Retry-After before polling Location.","content":{"application/json":{"schema":{"type":"object","required":["id","object","created","endpoint","status"],"properties":{"id":{"type":"string","description":"Job id returned at submission.","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"object":{"type":"string","const":"job","isRequired":true,"uniqueKey":"object","typeLabel":"string"},"created":{"type":"integer","description":"Unix time in seconds.","isRequired":true,"uniqueKey":"created","typeLabel":"integer"},"endpoint":{"type":"string","enum":["/v1/images/generations","/v1/images/edits"],"isRequired":true,"uniqueKey":"endpoint","typeLabel":"enum\u003cstring>"},"status":{"type":"string","const":"queued","isRequired":true,"uniqueKey":"status","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","object":"job","created":123,"endpoint":"/v1/images/generations","status":"queued"}}},"exampleType":"generated"}},"headers":{"x-request-id":{"description":"Identifier for this API response.","schema":{"type":"string"}},"x-ratelimit-limit-concurrent":{"description":"Job slots per account across all tokens.","schema":{"type":"integer","const":4}},"x-ratelimit-remaining-concurrent":{"description":"Free account slots when headers are sent.","schema":{"type":"integer","minimum":0,"maximum":4}},"Location":{"description":"Relative path to poll with GET.","schema":{"type":"string","format":"uri-reference"}},"Retry-After":{"description":"Seconds to wait. 2 on async submission and unfinished polls, 1 on a 429, and 30 on HTTP 503 no_provider.","schema":{"type":"integer"}}},"exampleType":"generated"},"7df29c50-706c-4d7c-b797-9f8c0a8457bb":{"description":"A field failed validation (invalid_value, model_not_found or unsupported_value), the body could not be read (null), a content check failed (content_policy_violation), or the job input was malformed (invalid_input).","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","param","code"],"properties":{"message":{"type":"string","description":"What went wrong, for a person to read.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"402 uses insufficient_quota, other 4xx errors use invalid_request_error, and 5xx errors use api_error.","enum":["invalid_request_error","insufficient_quota","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"price_credits":{"type":"number","description":"Job price in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.price_credits","typeLabel":"number"},"balance_credits":{"type":"number","description":"Account balance in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.balance_credits","typeLabel":"number"}},"conditionallyRequiredProperties":{"price_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"balance_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}]},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"Choose a temperature from 0 to 2.","type":"invalid_request_error","param":"temperature","code":"invalid_value"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Choose a temperature from 0 to 2.","type":"invalid_request_error","param":"temperature","code":"invalid_value"}}}},"exampleType":"examples"}},"headers":{"x-request-id":{"description":"Identifier for this API response.","schema":{"type":"string"}},"x-ratelimit-limit-concurrent":{"description":"Job slots per account across all tokens.","schema":{"type":"integer","const":4}},"x-ratelimit-remaining-concurrent":{"description":"Free account slots when headers are sent.","schema":{"type":"integer","minimum":0,"maximum":4}},"X-ShareMyAI-Cost-Credits":{"description":"Quoted price in credits when a job was accepted. For a Janus batch, the total for completed pictures.","schema":{"type":"number"}},"X-ShareMyAI-Balance-Credits":{"description":"Balance in credits after the hold, from the last successful quote on a Janus batch.","schema":{"type":"number"}},"X-ShareMyAI-Max-Tokens":{"description":"Only on chat requests whose output budget was capped.","schema":{"type":"integer","const":4096}},"x-should-retry":{"description":"Suppress automatic retries for insufficient_quota, content_policy_violation or no_provider.","schema":{"type":"string","const":"false"}}},"exampleType":"examples"},"d24cc0b7-f675-4adb-a7b8-e28f0c1fbb06":{"description":"The message distinguishes a missing token, a key without the smai_ prefix and an unknown or revoked ShareMyAI token.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","param","code"],"properties":{"message":{"type":"string","description":"What went wrong, for a person to read.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"402 uses insufficient_quota, other 4xx errors use invalid_request_error, and 5xx errors use api_error.","enum":["invalid_request_error","insufficient_quota","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"price_credits":{"type":"number","description":"Job price in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.price_credits","typeLabel":"number"},"balance_credits":{"type":"number","description":"Account balance in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.balance_credits","typeLabel":"number"}},"conditionallyRequiredProperties":{"price_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"balance_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}]},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"Send your API token as Authorization: Bearer smai_…. Create one at https://sharemy.ai, account panel, API tokens.","type":"invalid_request_error","param":null,"code":"invalid_api_key"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"Send your API token as Authorization: Bearer smai_…. Create one at https://sharemy.ai, account panel, API tokens.","type":"invalid_request_error","param":null,"code":"invalid_api_key"}}}},"exampleType":"examples"}},"headers":{"x-request-id":{"description":"Identifier for this API response.","schema":{"type":"string"}},"x-ratelimit-limit-concurrent":{"description":"Job slots per account across all tokens.","schema":{"type":"integer","const":4}},"x-ratelimit-remaining-concurrent":{"description":"Free account slots when headers are sent.","schema":{"type":"integer","minimum":0,"maximum":4}}},"exampleType":"examples"},"681e5d55-d320-48a4-9d9a-eb1aa85e6875":{"description":"The balance is less than the job's price.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","param","code"],"properties":{"message":{"type":"string","description":"What went wrong, for a person to read.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"402 uses insufficient_quota, other 4xx errors use invalid_request_error, and 5xx errors use api_error.","enum":["invalid_request_error","insufficient_quota","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"price_credits":{"type":"number","description":"Job price in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.price_credits","typeLabel":"number"},"balance_credits":{"type":"number","description":"Account balance in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.balance_credits","typeLabel":"number"}},"conditionallyRequiredProperties":{"price_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"balance_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}]},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"This costs 8.192 credits and your balance is 3.000 credits. Add credits at https://sharemy.ai.","type":"insufficient_quota","param":null,"code":"insufficient_quota","price_credits":8.192,"balance_credits":3}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"This costs 8.192 credits and your balance is 3.000 credits. Add credits at https://sharemy.ai.","type":"insufficient_quota","param":null,"code":"insufficient_quota","price_credits":8.192,"balance_credits":3}}}},"exampleType":"examples"}},"headers":{"x-request-id":{"description":"Identifier for this API response.","schema":{"type":"string"}},"x-ratelimit-limit-concurrent":{"description":"Job slots per account across all tokens.","schema":{"type":"integer","const":4}},"x-ratelimit-remaining-concurrent":{"description":"Free account slots when headers are sent.","schema":{"type":"integer","minimum":0,"maximum":4}},"X-ShareMyAI-Max-Tokens":{"description":"Only on chat requests whose output budget was capped.","schema":{"type":"integer","const":4096}},"x-should-retry":{"description":"Suppress automatic retries for insufficient_quota, content_policy_violation or no_provider.","schema":{"type":"string","const":"false"}}},"exampleType":"examples"},"771e4189-cc9e-448c-b90b-fe2adb061177":{"description":"The account is suspended.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","param","code"],"properties":{"message":{"type":"string","description":"What went wrong, for a person to read.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"402 uses insufficient_quota, other 4xx errors use invalid_request_error, and 5xx errors use api_error.","enum":["invalid_request_error","insufficient_quota","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"price_credits":{"type":"number","description":"Job price in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.price_credits","typeLabel":"number"},"balance_credits":{"type":"number","description":"Account balance in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.balance_credits","typeLabel":"number"}},"conditionallyRequiredProperties":{"price_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"balance_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}]},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"This account is suspended. If you think that is a mistake, contact us.","type":"invalid_request_error","param":null,"code":"account_suspended"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"This account is suspended. If you think that is a mistake, contact us.","type":"invalid_request_error","param":null,"code":"account_suspended"}}}},"exampleType":"examples"}},"headers":{"x-request-id":{"description":"Identifier for this API response.","schema":{"type":"string"}},"x-ratelimit-limit-concurrent":{"description":"Job slots per account across all tokens.","schema":{"type":"integer","const":4}},"x-ratelimit-remaining-concurrent":{"description":"Free account slots when headers are sent.","schema":{"type":"integer","minimum":0,"maximum":4}},"X-ShareMyAI-Cost-Credits":{"description":"Quoted price in credits when a job was accepted. For a Janus batch, the total for completed pictures.","schema":{"type":"number"}},"X-ShareMyAI-Balance-Credits":{"description":"Balance in credits after the hold, from the last successful quote on a Janus batch.","schema":{"type":"number"}},"X-ShareMyAI-Max-Tokens":{"description":"Only on chat requests whose output budget was capped.","schema":{"type":"integer","const":4096}}},"exampleType":"examples"},"67fc502c-18ed-45c6-ad27-ef9e8088f046":{"description":"The path exists. Use a method listed in Allow (method_not_allowed).","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","param","code"],"properties":{"message":{"type":"string","description":"What went wrong, for a person to read.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"402 uses insufficient_quota, other 4xx errors use invalid_request_error, and 5xx errors use api_error.","enum":["invalid_request_error","insufficient_quota","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"price_credits":{"type":"number","description":"Job price in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.price_credits","typeLabel":"number"},"balance_credits":{"type":"number","description":"Account balance in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.balance_credits","typeLabel":"number"}},"conditionallyRequiredProperties":{"price_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"balance_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}]},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","param":"\u003cstring>","code":"model_not_found","price_credits":123,"balance_credits":123}}}},"exampleType":"generated"}},"headers":{"x-request-id":{"description":"Identifier for this API response.","schema":{"type":"string"}},"x-ratelimit-limit-concurrent":{"description":"Job slots per account across all tokens.","schema":{"type":"integer","const":4}},"x-ratelimit-remaining-concurrent":{"description":"Free account slots when headers are sent.","schema":{"type":"integer","minimum":0,"maximum":4}},"Allow":{"description":"Methods available for the requested path, including OPTIONS.","schema":{"type":"string"}}},"exampleType":"generated"},"36d31969-d4cf-407c-a24d-969048baefa1":{"description":"Four job calls are already in flight across the account's tokens, or eligible machines stayed busy for 10 minutes. Both return rate_limit_exceeded.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","param","code"],"properties":{"message":{"type":"string","description":"What went wrong, for a person to read.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"402 uses insufficient_quota, other 4xx errors use invalid_request_error, and 5xx errors use api_error.","enum":["invalid_request_error","insufficient_quota","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"price_credits":{"type":"number","description":"Job price in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.price_credits","typeLabel":"number"},"balance_credits":{"type":"number","description":"Account balance in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.balance_credits","typeLabel":"number"}},"conditionallyRequiredProperties":{"price_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"balance_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}]},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"At most 4 API calls at once. Wait for one to finish.","type":"invalid_request_error","param":null,"code":"rate_limit_exceeded"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"At most 4 API calls at once. Wait for one to finish.","type":"invalid_request_error","param":null,"code":"rate_limit_exceeded"}}}},"exampleType":"examples"}},"headers":{"x-request-id":{"description":"Identifier for this API response.","schema":{"type":"string"}},"x-ratelimit-limit-concurrent":{"description":"Job slots per account across all tokens.","schema":{"type":"integer","const":4}},"x-ratelimit-remaining-concurrent":{"description":"Free account slots when headers are sent.","schema":{"type":"integer","minimum":0,"maximum":4}},"X-ShareMyAI-Cost-Credits":{"description":"Quoted price in credits when a job was accepted. For a Janus batch, the total for completed pictures.","schema":{"type":"number"}},"X-ShareMyAI-Balance-Credits":{"description":"Balance in credits after the hold, from the last successful quote on a Janus batch.","schema":{"type":"number"}},"X-ShareMyAI-Max-Tokens":{"description":"Only on chat requests whose output budget was capped.","schema":{"type":"integer","const":4096}},"Retry-After":{"description":"Seconds to wait. 2 on async submission and unfinished polls, 1 on a 429, and 30 on HTTP 503 no_provider.","schema":{"type":"integer"}}},"exampleType":"examples"},"6d4022a6-442f-4fc6-ae3a-2aa823975af9":{"description":"The caller hung up before the job finished. The job was dropped and its credits returned.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","param","code"],"properties":{"message":{"type":"string","description":"What went wrong, for a person to read.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"402 uses insufficient_quota, other 4xx errors use invalid_request_error, and 5xx errors use api_error.","enum":["invalid_request_error","insufficient_quota","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"price_credits":{"type":"number","description":"Job price in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.price_credits","typeLabel":"number"},"balance_credits":{"type":"number","description":"Account balance in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.balance_credits","typeLabel":"number"}},"conditionallyRequiredProperties":{"price_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"balance_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}]},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","param":"\u003cstring>","code":"model_not_found","price_credits":123,"balance_credits":123}}}},"exampleType":"generated"}},"headers":{"x-request-id":{"description":"Identifier for this API response.","schema":{"type":"string"}},"x-ratelimit-limit-concurrent":{"description":"Job slots per account across all tokens.","schema":{"type":"integer","const":4}},"x-ratelimit-remaining-concurrent":{"description":"Free account slots when headers are sent.","schema":{"type":"integer","minimum":0,"maximum":4}},"X-ShareMyAI-Cost-Credits":{"description":"Quoted price in credits when a job was accepted. For a Janus batch, the total for completed pictures.","schema":{"type":"number"}},"X-ShareMyAI-Balance-Credits":{"description":"Balance in credits after the hold, from the last successful quote on a Janus batch.","schema":{"type":"number"}},"X-ShareMyAI-Max-Tokens":{"description":"Only on chat requests whose output budget was capped.","schema":{"type":"integer","const":4096}}},"exampleType":"generated"},"b5d64c3b-cc3f-4667-9d92-9569ad2e0110":{"description":"The job failed on the network, for example after three machines in turn left or stopped answering. Its credits were returned.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","param","code"],"properties":{"message":{"type":"string","description":"What went wrong, for a person to read.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"402 uses insufficient_quota, other 4xx errors use invalid_request_error, and 5xx errors use api_error.","enum":["invalid_request_error","insufficient_quota","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"price_credits":{"type":"number","description":"Job price in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.price_credits","typeLabel":"number"},"balance_credits":{"type":"number","description":"Account balance in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.balance_credits","typeLabel":"number"}},"conditionallyRequiredProperties":{"price_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"balance_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}]},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"message":"The machine running this left the network. (request 69ba81e5-6a67-4cd5-a28b-2e023337b936)","type":"api_error","param":null,"code":"network_error"}},"examples":{"Example":{"title":"Example","value":{"error":{"message":"The machine running this left the network. (request 69ba81e5-6a67-4cd5-a28b-2e023337b936)","type":"api_error","param":null,"code":"network_error"}}}},"exampleType":"examples"}},"headers":{"x-request-id":{"description":"Identifier for this API response.","schema":{"type":"string"}},"x-ratelimit-limit-concurrent":{"description":"Job slots per account across all tokens.","schema":{"type":"integer","const":4}},"x-ratelimit-remaining-concurrent":{"description":"Free account slots when headers are sent.","schema":{"type":"integer","minimum":0,"maximum":4}},"X-ShareMyAI-Cost-Credits":{"description":"Quoted price in credits when a job was accepted. For a Janus batch, the total for completed pictures.","schema":{"type":"number"}},"X-ShareMyAI-Balance-Credits":{"description":"Balance in credits after the hold, from the last successful quote on a Janus batch.","schema":{"type":"number"}},"X-ShareMyAI-Max-Tokens":{"description":"Only on chat requests whose output budget was capped.","schema":{"type":"integer","const":4096}}},"exampleType":"examples"},"28a981ea-18ce-4fb7-8d20-8c2482a2764f":{"description":"no_provider when no eligible machine can run a synchronous job. storage_unavailable when async result storage is unavailable at submission. Retry-After and x-should-retry apply to no_provider.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","param","code"],"properties":{"message":{"type":"string","description":"What went wrong, for a person to read.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"type":"string","description":"402 uses insufficient_quota, other 4xx errors use invalid_request_error, and 5xx errors use api_error.","enum":["invalid_request_error","insufficient_quota","api_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"enum\u003cstring>"},"param":{"oneOf":[{"type":"string","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field at fault, when there is one.","isRequired":true,"uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.param","typeLabel":"string | null"},"code":{"oneOf":[{"type":"string","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"A stable code. The Errors and limits page lists them all.","examples":["model_not_found"],"isRequired":true,"uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string | null"},"price_credits":{"type":"number","description":"Job price in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.price_credits","typeLabel":"number"},"balance_credits":{"type":"number","description":"Account balance in credits on an insufficient_quota error.","conditionalRequirements":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"uniqueKey":"error.balance_credits","typeLabel":"number"}},"conditionallyRequiredProperties":{"price_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}],"balance_credits":[{"when":[[{"property":"code","values":["insufficient_quota"],"matchesAbsent":true}]]}]},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"\u003cstring>","type":"invalid_request_error","param":"\u003cstring>","code":"model_not_found","price_credits":123,"balance_credits":123}}}},"exampleType":"generated"}},"headers":{"x-request-id":{"description":"Identifier for this API response.","schema":{"type":"string"}},"x-ratelimit-limit-concurrent":{"description":"Job slots per account across all tokens.","schema":{"type":"integer","const":4}},"x-ratelimit-remaining-concurrent":{"description":"Free account slots when headers are sent.","schema":{"type":"integer","minimum":0,"maximum":4}},"X-ShareMyAI-Cost-Credits":{"description":"Quoted price in credits when a job was accepted. For a Janus batch, the total for completed pictures.","schema":{"type":"number"}},"X-ShareMyAI-Balance-Credits":{"description":"Balance in credits after the hold, from the last successful quote on a Janus batch.","schema":{"type":"number"}},"x-should-retry":{"description":"Suppress automatic retries for insufficient_quota, content_policy_violation or no_provider.","schema":{"type":"string","const":"false"}},"Retry-After":{"description":"Seconds to wait. 2 on async submission and unfinished polls, 1 on a 429, and 30 on HTTP 503 no_provider.","schema":{"type":"integer"}}},"exampleType":"generated"}},"security":{"71b12b07-8dbf-4305-a126-1d5ec1931f4f":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API token from the account panel on sharemy.ai. Tokens start with `smai_`.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"7c2efbf2-420a-42c5-bf21-35c4f72785c6":{"url":"https://sharemy.ai","description":"ShareMyAI"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"An API token from the account panel on sharemy.ai. Tokens start with `smai_`.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An API token from the account panel on sharemy.ai. Tokens start with `smai_`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"catswithkeyboards","siteName":"ShareMyAI","title":"Create images - ShareMyAI","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-12-05T18:14:19.815Z","originalFileLocation":"api-reference/image-generations.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=\"Make one to four pictures from a prompt with Z-Image Turbo, FLUX.2 Klein or Janus-Pro. Pictures come back as base64 PNG.\">\u003cmeta data-mint-head name=\"application-name\" content=\"ShareMyAI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/catswithkeyboards/rMZQkoOnE2fe4EYS/_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/catswithkeyboards/rMZQkoOnE2fe4EYS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/catswithkeyboards/rMZQkoOnE2fe4EYS/_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/catswithkeyboards/rMZQkoOnE2fe4EYS/_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/catswithkeyboards/rMZQkoOnE2fe4EYS/_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/catswithkeyboards/rMZQkoOnE2fe4EYS/_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/catswithkeyboards/rMZQkoOnE2fe4EYS/_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/catswithkeyboards/rMZQkoOnE2fe4EYS/_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/catswithkeyboards/rMZQkoOnE2fe4EYS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create images - ShareMyAI\">\u003cmeta data-mint-head property=\"og:description\" content=\"Make one to four pictures from a prompt with Z-Image Turbo, FLUX.2 Klein or Janus-Pro. Pictures come back as base64 PNG.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ShareMyAI docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.sharemy.ai/api-reference/image-generations\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.sharemy.ai/images/og.jpg\">\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 images - ShareMyAI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Make one to four pictures from a prompt with Z-Image Turbo, FLUX.2 Klein or Janus-Pro. Pictures come back as base64 PNG.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.sharemy.ai/images/og.jpg\">\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/catswithkeyboards/rMZQkoOnE2fe4EYS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ShareMyAI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#15171A\">\u003cmeta data-mint-head name=\"og:image:type\" content=\"image/jpeg\">\u003cmeta data-mint-head name=\"og:image:alt\" content=\"An OpenAI-compatible API on shared graphics cards.\">\u003cmeta data-mint-head name=\"twitter:image:alt\" content=\"An OpenAI-compatible API on shared graphics cards.\">\u003cmeta data-mint-head name=\"theme-color\" content=\"#F3F4F1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.sharemy.ai/api-reference/image-generations\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/image-generations.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.sharemy.ai/#organization\",\"name\":\"ShareMyAI\",\"url\":\"https://docs.sharemy.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/catswithkeyboards/kHqXtUmpvZnPdsJV/logo/light.svg?fit=max\u0026auto=format\u0026n=kHqXtUmpvZnPdsJV\u0026q=85\u0026s=3a3f657776cc3d70b3de85591e337616\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.sharemy.ai#website\",\"name\":\"ShareMyAI\",\"url\":\"https://docs.sharemy.ai\",\"publisher\":{\"@id\":\"https://docs.sharemy.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.sharemy.ai/api-reference/image-generations#webpage\",\"url\":\"https://docs.sharemy.ai/api-reference/image-generations\",\"name\":\"Create images\",\"description\":\"Make one to four pictures from a prompt with Z-Image Turbo, FLUX.2 Klein or Janus-Pro. Pictures come back as base64 PNG.\",\"dateModified\":\"2026-12-05T18:14:19.815Z\",\"isPartOf\":{\"@id\":\"https://docs.sharemy.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.sharemy.ai/api-reference/image-generations#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.sharemy.ai/api-reference/image-generations#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API reference\",\"item\":\"https://docs.sharemy.ai/api-reference/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create images\",\"item\":\"https://docs.sharemy.ai/api-reference/image-generations\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.sharemy.ai/api-reference/image-generations#apireference\",\"headline\":\"Create images\",\"name\":\"Create images\",\"description\":\"Make one to four pictures from a prompt with Z-Image Turbo, FLUX.2 Klein or Janus-Pro. Pictures come back as base64 PNG.\",\"url\":\"https://docs.sharemy.ai/api-reference/image-generations\",\"mainEntityOfPage\":{\"@id\":\"https://docs.sharemy.ai/api-reference/image-generations#webpage\"},\"image\":\"https://docs.sharemy.ai/images/og.jpg\",\"dateModified\":\"2026-12-05T18:14:19.815Z\",\"publisher\":{\"@id\":\"https://docs.sharemy.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.sharemy.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ShareMyAI\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"ShareMyAI\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/image-generations.md","siteName":"ShareMyAI","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/introduction"}]},{"tab":"API reference","groups":[{"group":"API reference","pages":[{"title":"API overview","href":"/api-reference/overview"},{"title":"List models","openapi":"api-reference/openapi.json GET /v1/models","href":"/api-reference/models"},{"title":"Create a chat completion","openapi":"api-reference/openapi.json POST /v1/chat/completions","description":"Answer a conversation with an open chat model such as Qwen3 or Gemma 4, as one JSON reply or as server-sent events.","href":"/api-reference/chat-completions"},{"title":"Create images","openapi":"api-reference/openapi.json POST /v1/images/generations","href":"/api-reference/image-generations"},{"title":"Edit an image","openapi":"api-reference/openapi.json POST /v1/images/edits","description":"Remove an object or watermark with LaMa. Upload a picture and a PNG mask to get a full-resolution PNG.","href":"/api-reference/image-edits"},{"title":"Image jobs","openapi":"api-reference/openapi.json GET /v1/jobs/{id}","href":"/api-reference/jobs"},{"title":"Create speech","openapi":"api-reference/openapi.json POST /v1/audio/speech","href":"/api-reference/audio-speech"},{"title":"Create a transcription","openapi":"api-reference/openapi.json POST /v1/audio/transcriptions","href":"/api-reference/audio-transcriptions"},{"title":"Create a translation","openapi":"api-reference/openapi.json POST /v1/audio/translations","href":"/api-reference/audio-translations"}]}]}]},"basePath":"","title":"Create images - ShareMyAI","deploymentId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","buildId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BuieBNTB.js","snippetPresets-alIv9Yoc.js","utils-BS41p-Nj.js","style-to-object-BY3JEAdk.js","utils-D0Za9LU_.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-Lx7TZ5XR.js","conditional-requirements-CFM0id0Q.js","cloneDeep-4e5CS5ZI.js","_Uint8Array-B2-W7EM3.js","isObject-FP1Yky1u.js","ApiExamples-sCe6z2hN.js","usePlaygroundInputsStore-cU_dFE5n.js","shallow-BwNCr__O.js","isEqual-Cnvzqd4L.js","CodeSnippets-CMIr49P8.js","CodeSnippet-BC-bKzyy.js","use-playground-group-access-c3bgmn-x.js","Page-Acw_JRP6.js","api-description-markdown-1o8U1kkQ.js","DynamicMarkdown-CvOkzads.js","SectionHeading-CJ97Kdt-.js","MethodPill-DynWltjQ.js","getPastedJson-CBCnXiWl.js","Check2Icon-CPHq_WNu.js","axios-CsQoIw0U.js","Markdown-4tjIF-hK.js","AssistantPageLink-BcChI7L3.js","dist-MIf_HGLZ.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}