/api/v1/messagesFor multi-turn context in a messages array, with text generation through upstream OpenRouter.
Back to Chat / Text endpoint listRequest parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | OpenRouterPublicModelId | Yes | GR public model ids used in request bodies. |
messages | ChatMessage[] | Yes | See the OpenAPI schema for field details. |
messages[].role | string | Yes | Allowed values: system, user, assistant, tool. |
messages[].content | string | object[] | Yes | See the OpenAPI schema for field details. |
provider | string | OpenRouterProviderRouting | No | See the OpenAPI schema for field details. |
max_tokens | integer | No | See the OpenAPI schema for field details. |
Response fields
| Field | Type | Required | Description |
|---|---|---|---|
body | object | No | Object fields are passed through according to the current OpenRouter or GR endpoint implementation. |
Errors
401
UNAUTHORIZEDMissing or invalid Authorization Bearer token.
403
FORBIDDENThe current API key is not authorized for this scope, model, or management capability.
422
VALIDATION_ERRORThe request body, path parameters, or query parameters do not match the endpoint schema.
Notes
- Use a GlobalRouter API key; upstream OpenRouter API keys are never exposed to tenants.