Create a chat completion
POST/v1/chat/completions
OpenAI Chat Completions, on any model in the catalog. Send model (an alias) and messages; set stream: true for text/event-stream chunks terminated by data: [DONE]. Parameters the target model cannot take are dropped and named in X-MindsHub-Dropped-Params, and parts of the request the target cannot carry in X-MindsHub-Dropped-Content (a stream whose 200 went out early carries neither); response_format is the one thing refused with a 400 instead. The response's model names the model that served (mindshub_air and mindshub_blaze return their own alias), and it can be sent back as-is.
Request
Responses
- 200
- 400
- 401
- 402
- 403
- 404
- 429
- 503
The completion. Exactly one choice.
Response Headers
Upstream attempts the request took, requested model and fallbacks together. 1 means the first try answered. Never sent on a stream whose 200 went out early because its response took more than 90 seconds to start, so there its absence says nothing.
Parameters adjusted to the model's range, as name=requested>applied. Absent when nothing was clamped. Never sent on a stream whose 200 went out early because its response took more than 90 seconds to start, so there its absence says nothing.
Comma-separated categories of request structure the target model could not take: content blocks and per-block keys, message fields, tool keys, and tool schemas rewritten into the target's dialect (e.g. block_field.cache_control,content_block.thinking,tool_schema.gemini_openapi). Category labels, not an inventory, and capped at 16 with a trailing more.N. Absent when nothing was dropped. Never sent on a stream whose 200 went out early because its response took more than 90 seconds to start, so there its absence says nothing.
Comma-separated parameters the target model could not take and that were dropped. Absent when nothing was dropped. Never sent on a stream whose 200 went out early because its response took more than 90 seconds to start, so there its absence says nothing.
true when a fallback model produced the response, false when the requested model did. Present, on errors too, once the request reached a model. Never sent on a stream whose 200 went out early because its response took more than 90 seconds to start, so there its absence says nothing. On such a stream, read the mindshub field of its last event instead (message_delta on Messages). A Chat Completions or Messages stream that fails after its early 200 carries no failover signal at all.
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).
Response Headers
Machine-readable denial reason (permission_denied, rate_limited, included_allowance_exhausted, free_air_daily_spend_fuse_exceeded, wallet_empty).
Relative console URL where credit can be added.
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.
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, free_air_daily_spend_fuse_exceeded, wallet_empty).
Unknown model alias (model_not_found).
Too fast (rate_limited, retry after Retry-After), the included allowance is exhausted (included_allowance_exhausted), or free serving is paused until the daily budget resets (free_air_daily_spend_fuse_exceeded). The last two carry body reset_at and X-MindsHub-Reset-At, and x-should-retry: false; adding credit lifts either 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, free_air_daily_spend_fuse_exceeded, wallet_empty).
ISO-8601 instant the allowance refills or free serving resumes. Absent on included_allowance_exhausted when the organization has no included allowance.
false on included_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.
The authorization gate is unavailable (policy_unavailable). Retry.