For the complete documentation index, see llms.txt. This page is also available as Markdown.

Responses

Create Response

post

Creates responses with conversation state management. Supports previous_response_id for context continuity, function calling, web search, and file inputs. Compatible with OpenAI, Azure, and X-AI (Grok) providers.

Authorizations
AuthorizationstringRequired

FastRouter API Key. Get yours at https://fastrouter.ai

Format: Authorization: Bearer YOUR_API_KEY

Body
modelstringRequired

Model ID in provider/model format. Examples: openai/o3, openai/gpt-4.1, x-ai/grok-4

Example: openai/o3
inputone ofRequired

User input - can be a simple string or array of message objects for multimodal/file inputs

stringOptional

Simple text input

or
previous_response_idstringOptional

ID of a previous response to continue the conversation. Maintains context across requests.

Example: fr_ID123
streambooleanOptional

Enable streaming responses for real-time output

Default: false
tool_choicestring · enumOptional

Controls tool usage. 'auto' lets model decide, 'none' disables tools.

Default: autoPossible values:
temperaturenumber · max: 2Optional

Sampling temperature for randomness control

Default: 1
max_tokensintegerOptional

Maximum tokens to generate

backgroundbooleanOptional

Run response generation in background

Default: false
Responses
200

Successful response

application/json
idstringOptional

Unique response ID (use for previous_response_id)

Example: fr_ID123
objectstringOptionalExample: response
created_atintegerOptional

Unix timestamp

Example: 1764138326
modelstringOptional

Model used

Example: o3-2025-04-16
backgroundbooleanOptional

Whether request ran in background

errorstring · nullableOptional

Error message if any

post/api/v1/responses
POST /api/v1/responses HTTP/1.1
Host: api.fastrouter.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 102

{
  "model": "openai/o3",
  "input": "Tell me a three sentence bedtime story about a unicorn.",
  "stream": false
}
{
  "background": false,
  "created_at": 1764138326,
  "error": null,
  "id": "fr_ID123",
  "model": "o3-2025-04-16",
  "object": "response",
  "output": [
    {
      "id": "rs_ID123",
      "summary": [],
      "type": "reasoning"
    },
    {
      "id": "msg_ID123",
      "role": "assistant",
      "type": "message",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "text": "Under a silvery moon, a gentle unicorn named Liora tiptoed..."
        }
      ]
    }
  ]
}

Last updated