API Reference

Create Response

Creates a model response. Supports streaming via `stream: true`. Compatible with the OpenAI Responses API. Automatically routes to the best available provider (OpenAI, Anthropic, Google, etc.).

POST
/v1/responses

Authorization

ApiKeyAuth
AuthorizationBearer <token>

Your Yolo Router API key. Format: Bearer sk-...

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://api.yolorouter.com/v1/responses" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-4o",    "input": "Say hello in French."  }'
{
  "id": "resp_abc123",
  "object": "response",
  "model": "gpt-4o",
  "status": "completed",
  "output": [
    {
      "type": "message",
      "id": "string",
      "role": "string",
      "content": [
        {
          "type": "string",
          "text": "string"
        }
      ],
      "status": "string",
      "call_id": "string",
      "name": "string",
      "arguments": "string"
    }
  ],
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0,
    "total_tokens": 0,
    "input_tokens_details": {
      "cached_tokens": 0
    }
  },
  "error": {
    "code": "string",
    "message": "string"
  },
  "incomplete_details": {
    "reason": "max_output_tokens"
  }
}
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_api_key",
    "message": "Invalid API key"
  }
}
{
  "error": {
    "type": "insufficient_quota",
    "code": "insufficient_quota",
    "message": "Quota exceeded"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string"
  }
}