Create images
POST/v1/images/generations
OpenAI image generation on an image alias (gpt-image-2.6-flare). Images come back as b64_json. Billed to the wallet by text and image tokens, never to the included allowance.
Request
Responses
- 200
- 400
- 401
- 402
- 403
- 404
- 413
- 429
- 503
The images, and their usage.
Malformed body, or a parameter the target model cannot honor and that is refused rather than dropped (param_not_supported, invalid_param, max_tokens_exceeded, model_not_configured).
Missing or invalid Authorization: Bearer mdb_… (invalid_credentials).
The wallet is empty and this model is not covered by the included allowance (wallet_empty), or a spending budget is reached for this period (budget_exceeded). On budget_exceeded, error.budget_scope and X-MindsHub-Budget-Scope name whose budget it is: org, workspace, api_key, team, user or all_members, and possibly a newer scope, so treat an unknown value as unnamed. error.budget_period and X-MindsHub-Budget-Period name its period: day, month or year; for a per-model budget, error.budget_model and X-MindsHub-Budget-Model name its model.
Response Headers
On budget_exceeded for a per-model budget, the model it caps (its alias). Absent for a budget on every model.
On budget_exceeded, the spent budget's period: day, month or year.
On budget_exceeded, whose budget is spent: org, workspace or api_key, team, user or all_members. Treat any other value as unnamed.
Machine-readable denial reason (permission_denied, rate_limited, included_allowance_exhausted, window_allowance_exhausted, free_air_daily_spend_fuse_exceeded, wallet_empty, budget_exceeded, model_not_in_tier).
Relative console URL that fixes the denial: where credit can be added on wallet_empty, the budget setting on budget_exceeded.
The key is valid but not permitted here (permission_denied). When an administrator in your organization restricted the model, error.deny_detail and X-MindsHub-Deny-Detail read model_restricted: choose another model, since credit does not lift it. model_not_in_tier means your plan's included allowance does not cover the model and your wallet cannot pay for it; the body's required_tier names the plan that covers it. Upgrading or adding credit lifts it.
Response Headers
The specific cause behind permission_denied. model_restricted when an administrator in your organization restricted the model; the body's error.deny_detail carries the same value. Absent on every other 403.
Machine-readable denial reason (permission_denied, rate_limited, included_allowance_exhausted, window_allowance_exhausted, free_air_daily_spend_fuse_exceeded, wallet_empty, budget_exceeded, model_not_in_tier).
On model_not_in_tier, the relative console URL where an upgrade or credit lifts the denial. Absent on every other 403.
Unknown model alias (model_not_found).
The request body is larger than 50 MiB (code: request_too_large).
Too fast (rate_limited, retry after Retry-After), the included allowance is exhausted (included_allowance_exhausted), one of your plan's rolling windows is used up (window_allowance_exhausted, with body window: 5h or 7d), or free serving is paused until the daily budget resets (free_air_daily_spend_fuse_exceeded). The last three carry body reset_at and X-MindsHub-Reset-At, and x-should-retry: false; adding credit lifts any of them immediately. An organization with no included allowance gets included_allowance_exhausted with no reset_at, because nothing refills; only credit lifts it.
Response Headers
Seconds to wait before retrying.
Machine-readable denial reason (permission_denied, rate_limited, included_allowance_exhausted, window_allowance_exhausted, free_air_daily_spend_fuse_exceeded, wallet_empty, budget_exceeded, model_not_in_tier).
On window_allowance_exhausted, the relative console URL where credit lifts the denial. Absent on every other 429.
ISO-8601 instant the allowance refills, the plan window frees up, or free serving resumes. Absent on included_allowance_exhausted when the organization has no included allowance.
false on included_allowance_exhausted, window_allowance_exhausted and free_air_daily_spend_fuse_exceeded, so the OpenAI and Anthropic SDKs return the error on the first attempt instead of retrying it. Absent on rate_limited, which is worth retrying.
MindsHub could not verify the access policy, or the provider failed. upstream_status: 504 (code: image_generation_timeout) means the images took longer than the request budget: ask for fewer, smaller or lower-quality images. upstream_status: 502 means the provider could not be reached, after which the images may still have been generated. Neither is safe to resend blindly.