orcarouter_chat
Send a single-turn chat request to OrcaRouter and get the assistant's response. Supports model fallback chains, direct provider calls, and automatic max_completion_tokens for reasoning models.
Instructions
Send a single-turn chat request to OrcaRouter and return the assistant's response text. Default model is the workspace's auto-router. Use orcarouter/<name> for other routers or <provider>/<model> for direct calls. For OpenAI reasoning models (gpt-5/o1/o3/...), max_tokens is automatically routed to max_completion_tokens at the wire level. The optional models array sets a fallback chain — the primary model is tried first, then each entry on failure (5 entries total max, including the primary). Errors are returned as text content with isError:true; common cases include missing API key, rate limits, and upstream provider outages. Requires ORCAROUTER_API_KEY.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model to call. Defaults to `orcarouter/auto` — your workspace's seeded auto-router. Use `orcarouter/<name>` for other workspace routers, or `<provider>/<model>` for direct upstream selection (e.g. `openai/gpt-4o-mini`, `anthropic/claude-haiku-4.5`). | orcarouter/auto |
| prompt | Yes | User message to send (single-turn). | |
| system_prompt | No | Optional system prompt prepended to the conversation. | |
| max_tokens | No | Maximum tokens to generate (default 10000). Automatically translated to max_completion_tokens for OpenAI reasoning models. | |
| temperature | No | Sampling temperature (default 0.7). | |
| models | No | Optional fallback chain. Models are tried in order if the primary fails. Max 5 entries including the primary. |