OpenRouter Models
OpenRouter Models — keyless JSON API
OpenRouter Models. This API allows users to browse various models available on the OpenRouter platform. It provides functionalities for users to access model details, compare different models, and explore their features and capabilities.
We probe a documented GET and expect 2xx JSON — full uptime and health score. Open provider docs ↗
On our probe schedule. Uptime charts appear after the first check lands.
GET https://openrouter.ai/openapi.json
{
"components": {
"parameters": {
"AppIdentifier": {
"name": "HTTP-Referer",
"in": "header",
"schema": {
"type": "string"
},
"description": "The app identifier should be your app's URL and is used as the primary identifier for rankings.\nThis is used to track API usage per application.\n"
},
"AppDisplayName": {
"name": "X-OpenRouter-Title",
"in": "header",
"x-speakeasy-name-override": "appTitle",
"schema": {
"type": "string"
},
"description": "The app display name allows you to customize how your app appears in OpenRouter's dashboard.\n"
},
"AppCategories": {
"name": "X-OpenRouter-Categories",
"in": "header",
"x-speakeasy-name-override": "appCategories",
"schema": {
"type": "string"
},
"description": "Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.\n"
}
},
"schemas": {
"AABenchmarkEntry": {
"description": "Artificial Analysis benchmark index scores.",
"example": {
"agentic_index": 55.8,
"coding_index": 63.2,
"intelligence_index": 71.4
},
"properties": {
"agentic_index": {
"description": "Artificial Analysis Agentic Index score",
"example": 55.8,
"format": "double",
"nullable": true,
"type": "number"
},
"coding_index": {
"description": "Artificial Analysis Coding Index score",
"example": 63.2,
"format": "double",
"nullable": true,
"type": "number"
},
"intelligence_index": {
"description": "Artificial Analysis Intelligence Index score",
"example": 71.4,
"format": "double",
"nullable": true,
"type": "number"
}
},
"required": [
"intelligence_index",
"coding_index"
],
"type": "object"
},
"ActivityItem": {
"example": {
"byok_usage_inference": 0.012,
"completion_tokens": 125,
"date": "2025-08-24",
"endpoint_id": "550e8400-e29b-41d4-a716-446655440000",
"model": "openai/gpt-4.1",
"model_permaslug": "openai/gpt-4.1-2025-04-14",
"prompt_tokens": 50,
"provider_name": "OpenAI"
},
"properties": {
"byok_usage_inference": {
"description": "BYOK inference cost in USD (external credits spent)",
"example": 0.012,
"format": "double",
"type": "number"
},
"completion_tokens": {
"description": "Total completion tokens generated",
"example": 125,
"type": "integer"
},
"date": {
"description": "Date of the activity (YYYY-MM-DD format)",
"example": "2025-08-24",
"type": "string"
},
"endpoint_id": {
"description": "Unique identifier for the endpoint",
"example": "550e8400-e29b-41d4-a716-446655440000",
"type": "string"
},
"model": {
"description": "Model slug (e.g., \"openai/gpt-4.1\")",
"example": "openai/gpt-4.1",
"type": "string"
},
"model_permaslug": {
"description": "Model permaslug (e.g., \"openai/gpt-4.1-2025-04-14\")",
"example": "openai/gpt-4.1-2025-04-14",
"type": "string"
},
"prompt_tokens": {
"description": "Total prompt tokens used",
"example": 50,
"type": "integer"
},
"provider_name": {
"description": "Name of the provider serving this endpoint",
"example": "OpenAI",
"type": "string"
}
},
"required": [
"date",
"model"
],
"type": "object"
},
"ActivityResponse": {
"example": {
"data": [
{
"byok_usage_inference": 0.012,
"completion_tokens": 125,
"date": "2025-08-24",
"endpoint_id": "550e8400-e29b-41d4-a716-446655440000",
"model": "openai/gpt-4.1",
"model_permaslug": "openai/gpt-4.1-2025-04-14",
"prompt_tokens": 50,
"provider_name": "OpenAI"
}
]
},
"properties": {
"data": {
"description": "List of activity items",
"items": {
"$ref": "#/components/schemas/ActivityItem"
},
"type": "array"
}
},
"required": [
"data"
],
"type": "object"
},
"AdvisorNestedTool": {
"additionalProperties": {
"nullable": true
},
"description": "A tool made available to the advisor sub-agent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the advisor has no way to execute them. The advisor tool may not list itself.",
"example": {
"type": "openrouter:web_search"
},
"properties": {
"parameters": {
"additionalProperties": {
"nullable": true
},
"type": "object"
},
"type": {
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"AdvisorReasoning": {
"description": "Reasoning configuration forwarded to the advisor call. Use this to control reasoning effort and token budget for models that support extended thinking.",
"example": {
"effort": "high"
},
"properties": {
"effort": {
"description": "Reasoning effort level for the advisor call.",
"enum": [
"max",
"xhigh"
],
"type": "string",
"x-speakeasy-unknown-values": "allow"
},
"max_tokens": {
"description": "Maximum number of reasoning tokens the advisor may use.",
"type": "integer"
}
},
"type": "object"
},
"AdvisorServerTool_OpenRouter": {
"description": "OpenRouter built-in server tool: consults a higher-intelligence advisor model (any OpenRouter model) for guidance mid-generation and returns its response. The advisor may run as a sub-agent with its own tools. Include multiple entries to offer several named advisors; at most one entry may omit `name` to act as the default advisor.",
"example": {
"parameters": {
"model": "~anthropic/claude-opus-latest",
"name": "reviewer"
},
"type": "openrouter:advisor"
},
"properties": {
"parameters": {
"$ref": "#/components/schemas/AdvisorServerToolConfig"
},
"type": {
"enum": [
"openrouter:advisor"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"AdvisorServerToolConfig": {
"description": "Configuration for one openrouter:advisor server tool entry.",
"example": {
"model": "~anthropic/claude-opus-latest",
"name": "reviewer"
},
"properties": {
"forward_transcript": {
"description": "When true, the full parent conversation is forwarded to the advisor so it sees the same context the executor does (and the tool-call `prompt`, if given, is appended as a final user turn). When false or omitted, the advisor receives only the `prompt` the executor passes in the tool call.",
"example": false,
"type": "boolean"
},
"instructions": {
"description": "System instructions for the advisor sub-agent. When omitted, the advisor responds with no system prompt of its own.",
"example": "You are a senior staff engineer. Give a focused, decisive plan.",
"type": "string"
},
"max_completion_tokens": {
"description": "Maximum number of output tokens (including reasoning) the advisor may produce. When omitted, the provider's default applies.",
"example": 2048,
"type": "integer"
},
"max_tool_calls": {
"description": "Maximum number of tool-calling steps the advisor sub-agent may take during its agentic loop. Capped at 25. Only relevant when the advisor is given tools.",
"example": 5,
"maximum": 25,
"minimum": 1,
"type": "integer"
},
"model": {
"description": "Slug of the advisor model to consult (any OpenRouter model). When omitted, the executor can choose it via the tool call's `model` argument; if neither is set, the model from the outer API request is used. The advisor tool itself cannot be the advisor model.",
"example": "~anthropic/claude-opus-latest",
"type": "string"
},
"name": {
"description": "Optional name for this advisor. The model sees one tool per named advisor (and one default for an unnamed entry). Names must be unique across advisor entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars.",
"example": "reviewer",
"maxLength": 64,
"minLength": 1,
"pattern": "^[a-zA-Z0-9 _-]+$",
"type": "string"
},
"reasoning": {
"$ref": "#/components/schemas/AdvisorReasoning"
},
"stream": {
"description": "When true, the advisor's advice streams incrementally as it is produced. In the Responses API this emits `response.output_text.delta` events targeting the advisor output item; the final `advice` field is still set on the completed item. Has no effect on the Chat Completions API (where the advice arrives only as the final tool result). When false or omitted, the advice arrives only as the final result.",
"example": false,
"type": "boolean"
}
},
"type": "object"
},
"AnnotationAddedEvent": {
"allOf": [
{
"$ref": "#/components/schemas/BaseAnnotationAddedEvent"
},
{
"properties": {},
"type": "object"
}
],
"description": "Event emitted when a text annotation is added to output",
"example": {
"annotation": {
"end_index": 7,
"start_index": 0,
"title": "Example",
"type": "url_citation",
"url": "https://example.com"
},
"annotation_index": 0,
"content_index": 0,
"item_id": "item-1",
"output_index": 0,
"sequence_number": 5,
"type": "response.output_text.annotation.added"
}
}
},
"securitySchemes": {
"apiKey": {
"description": "API key as bearer token in Authorization header",
"scheme": "bearer",
"type": "http"
},
"bearer": {
"description": "API key as bearer token in Authorization header",
"scheme": "bearer",
"type": "http"
}
}
},
"externalDocs": {
"description": "OpenRouter Documentation",
"url": "https://openrouter.ai/docs"
},
"info": {
"contact": {
"email": "support@openrouter.ai",
"name": "OpenRouter Support",
"url": "https://openrouter.ai/docs"
},
"description": "OpenAI-compatible API with additional OpenRouter features",
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
},
"title": "OpenRouter API",
"version": "1.0.0"
},
"openapi": "3.1.0",
"paths": {
"/activity": {
"get": {
"description": "Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Management key](/docs/guides/overview/auth/management-api-keys) required.",
"operationId": "getUserActivity",
"parameters": [
{
"description": "Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).",
"in": "query",
"name": "date",
"required": false,
"schema": {
"description": "Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).",
"example": "2025-08-24",
"type": "string"
}
},
{
"description": "Filter by API key hash (SHA-256 hex string, as returned by the keys API).",
"in": "query",
"name": "api_key_hash",
"required": false,
"schema": {
"description": "Filter by API key hash (SHA-256 hex string, as returned by the keys API).",
"example": "abc123def456...",
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"example": {
"data": [
{
"byok_usage_inference": 0.012,
"completion_tokens": 125,
"date": "2025-08-24",
"endpoint_id": "550e8400-e29b-41d4-a716-446655440000",
"model": "openai/gpt-4.1",
"model_permaslug": "openai/gpt-4.1-2025-04-14",
"prompt_tokens": 50,
"provider_name": "OpenAI"
}
]
},
"schema": {
"$ref": "#/components/schemas/ActivityResponse"
}
}
},
"description": "Returns user activity data grouped by endpoint"
},
"400": {
"content": {
"application/json": {
"example": {
"error": {
"code": 400,
"message": "Invalid request parameters"
}
},
"schema": {
"$ref": "#/components/schemas/BadRequestResponse"
}
}
},
"description": "Bad Request - Invalid request parameters or malformed input"
},
"401": {
"content": {
"application/json": {
"example": {
"error": {
"code": 401,
"message": "Missing Authentication header"
}
},
"schema": {
"$ref": "#/components/schemas/UnauthorizedResponse"
}
}
},
"description": "Unauthorized - Authentication required or invalid credentials"
},
"403": {
"content": {
"application/json": {
"example": {
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
},
"schema": {
"$ref": "#/components/schemas/ForbiddenResponse"
}
}
},
"description": "Forbidden - Authentication successful but insufficient permissions"
},
"404": {
"content": {
"application/json": {
"example": {
"error": {
"code": 404,
"message": "Resource not found"
}
},
"schema": {
"$ref": "#/components/schemas/NotFoundResponse"
}
}
},
"description": "Not Found - Resource does not exist"
},
"500": {
"content": {
"application/json": {
"example": {
"error": {
"code": 500,
"message": "Internal Server Error"
}
},
"schema": {
"$ref": "#/components/schemas/InternalServerResponse"
}
}
},
"description": "Internal Server Error - Unexpected server error"
}
},
"summary": "Get user activity grouped by endpoint",
"tags": [
"Analytics"
]
},
"parameters": [
{
"$ref": "#/components/parameters/AppIdentifier"
},
{
"$ref": "#/components/parameters/AppDisplayName"
}
]
},
"/analytics/meta": {
"get": {
"description": "Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.",
"operationId": "getAnalyticsMeta",
"responses": {
"200": {
"content": {
"application/json": {
"example": {
"data": {
"dimensions": [
{
"display_label": "Model",
"name": "model"
}
],
"granularities": [
{
"display_label": "Day",
"name": "day"
}
],
"metrics": [
{
"display_format": "number",
"display_label": "Request Count",
"is_rate": false,
"name": "request_count"
}
],
"operators": [
{
"name": "eq",
"value_type": "scalar"
}
]
}
},
"schema": {
"properties": {
"data": {
"properties": {
"dimensions": {
"items": {
"properties": {
"display_label": {
"description": "Human-readable label",
"example": "Model",
"type": "string"
},
"name": {
"description": "Dimension identifier used in query requests",
"example": "model",
"type": "string"
}
},
"required": [
"name",
"display_label"
],
"type": "object"
},
"type": "array"
},
"granularities": {
"items": {
"properties": {
"display_label": {
"description": "Human-readable label",
"example": "Day",
"type": "string"
},
"name": {
"description": "Granularity identifier",
"enum": [
"minute",
"hour"
],
"example": "day",
"type": "string",
"x-speakeasy-unknown-values": "allow"
}
},
"required": [
"name",
"display_label"
],
"type": "object"
},
"type": "array"
},
"metrics": {
"items": {
"properties": {
"display_format": {
"description": "How this metric value should be formatted for display (e.g. percent → multiply by 100 and append %, currency → prefix with $)",
"enum": [
"number",
"currency"
],
"example": "number",
"type": "string",
"x-speakeasy-unknown-values": "allow"
},
"display_label": {
"description": "Human-readable label",
"example": "Request Count",
"type": "string"
},
"is_rate": {
"description": "Whether this metric is a rate/ratio (averaged, not summed)",
"type": "boolean"
},
"name": {
"description": "Metric identifier used in query requests",
"example": "request_count",
"type": "string"
}
},
"required": [
"name",
"display_label"
],
"type": "object"
},
"type": "array"
},
"operators": {
"items": {
"properties": {
"name": {
"description": "Operator identifier used in filter definitions",
"enum": [
"eq",
"neq"
],
"example": "eq",
"type": "string",
"x-speakeasy-unknown-values": "allow"
},
"value_type": {
"description": "Whether the operator expects a single value or an array",
"enum": [
"scalar",
"array"
],
"type": "string",
"x-speakeasy-unknown-values": "allow"
}
},
"required": [
"name",
"value_type"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"metrics",
"dimensions"
],
"type": "object"
}
},
"required": [
"data"
],
"type": "object"
}
}
},
"description": "Returns analytics query metadata"
},
"401": {
"content": {
"application/json": {
"example": {
"error": {
"code": 401,
"message": "Missing Authentication header"
}
},
"schema": {
"$ref": "#/components/schemas/UnauthorizedResponse"
}
}
},
"description": "Unauthorized - Authentication required or invalid credentials"
},
"403": {
"content": {
"application/json": {
"example": {
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
},
"schema": {
"$ref": "#/components/schemas/ForbiddenResponse"
}
}
},
"description": "Forbidden - Authentication successful but insufficient permissions"
},
"500": {
"content": {
"application/json": {
"example": {
"error": {
"code": 500,
"message": "Internal Server Error"
}
},
"schema": {
"$ref": "#/components/schemas/InternalServerResponse"
}
}
},
"description": "Internal Server Error - Unexpected server error"
}
},
"summary": "Get available analytics metrics and dimensions",
"tags": [
"beta.Analytics"
]
},
"parameters": [
{
"$ref": "#/components/parameters/AppIdentifier"
},
{
"$ref": "#/components/parameters/AppDisplayName"
}
]
},
"/analytics/query": {
"post": {
"description": "Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.",
"operationId": "queryAnalytics",
"requestBody": {
"content": {
"application/json": {
"example": {
"dimensions": [
"model"
],
"granularity": "day",
"limit": 100,
"metrics": [
"request_count"
],
"time_range": {
"end": "2025-01-08T00:00:00Z",
"start": "2025-01-01T00:00:00Z"
}
},
"schema": {
"properties": {
"dimensions": {
"items": {
"description": "Dimension to group by (up to 2). Use the /meta endpoint for available dimensions.",
"example": "model",
"type": "string"
},
"maxItems": 2,
"type": "array"
},
"filters": {
"items": {
"properties": {
"field": {
"description": "Dimension to filter on. Use the /meta endpoint for available dimensions.",
"example": "model",
"type": "string"
},
"operator": {
"description": "Filter operator",
"example": "eq",
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"format": "double",
"type": "number"
}
],
"description": "Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. \"user_abc123\"), not the display name; `workspace` — workspace UUID, not the workspace name; `app` — numeric app ID, not the app title; `model` — permaslug (e.g. \"openai/gpt-4o\"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned."
}
},
"required": [
"field",
"operator"
],
"type": "object"
},
"maxItems": 20,
"type": "array"
},
"granularity": {
"description": "Time granularity",
"example": "day",
"type": "string"
},
"group_limit": {
"description": "Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified.",
"example": 100,
"type": "integer"
},
"limit": {
"description": "Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations.",
"type": "integer"
},
"metrics": {
"items": {
"description": "Metric name",
"example": "request_count",
"type": "string"
},
"minItems": 1,
"type": "array"
},
"order_by": {
"properties": {
"direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"x-speakeasy-unknown-values": "allow"
},
"field": {
"description": "Field to order by",
"example": "request_count",
"type": "string"
}
},
"required": [
"field",
"direction"
],
"type": "object"
},
"time_range": {
"properties": {
"end": {
"format": "date-time",
"type": "string"
},
"start": {
"format": "date-time",
"type": "string"
}
},
"required": [
"start",
"end"
],
"type": "object"
}
},
"required": [
"metrics"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"example": {
"data": {
"data": [
{
"date__day": "2025-01-01T00:00:00.000Z",
"request_count": 1500
}
],
"metadata": {
"query_time_ms": 42,
"row_count": 1,
"truncated": false
}
}
},
"schema": {
"properties": {
"data": {
"properties": {
"cachedAt": {
"format": "double",
"type": "number"
},
"data": {
"items": {
"description": "A row of analytics data with metric/dimension values",
"type": "object"
},
"type": "array"
},
"metadata": {
"properties": {
"query_time_ms": {
"format": "double",
"type": "number"
},
"row_count": {
"type": "integer"
},
"truncated": {
"type": "boolean"
}
},
"required": [
"query_time_ms",
"row_count"
],
"type": "object"
},
"warnings": {
"description": "Warnings about filter resolution issues (e.g. unresolvable api_key_id hashes). The query still runs normally; these inform the caller that some filter values could not be resolved.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"data",
"metadata"
],
"type": "object"
}
},
"required": [
"data"
],
"type": "object"
}
}
},
"description": "Analytics query results"
},
"400": {
"content": {
"application/json": {
"example": {
"error": {
"code": 400,
"message": "Invalid request parameters"
}
},
"schema": {
"$ref": "#/components/schemas/BadRequestResponse"
}
}
},
"description": "Bad Request - Invalid request parameters or malformed input"
},
"401": {
"content": {
"application/json": {
"example": {
"error": {
"code": 401,
"message": "Missing Authentication header"
}
},
"schema": {
"$ref": "#/components/schemas/UnauthorizedResponse"
}
}
},
"description": "Unauthorized - Authentication required or invalid credentials"
},
"403": {
"content": {
"application/json": {
"example": {
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
},
"schema": {
"$ref": "#/components/schemas/ForbiddenResponse"
}
}
},
"description": "Forbidden - Authentication successful but insufficient permissions"
},
"408": {
"content": {
"application/json": {
"example": {
"error": {
"code": 408,
"message": "Operation timed out. Please try again later."
}
},
"schema": {
"$ref": "#/components/schemas/RequestTimeoutResponse"
}
}
},
"description": "Request Timeout - Operation exceeded time limit"
},
"500": {
"content": {
"application/json": {
"example": {
"error": {
"code": 500,
"message": "Internal Server Error"
}
},
"schema": {
"$ref": "#/components/schemas/InternalServerResponse"
}
}
},
"description": "Internal Server Error - Unexpected server error"
}
},
"summary": "Query analytics data",
"tags": [
"beta.Analytics"
]
},
"parameters": [
{
"$ref": "#/components/parameters/AppIdentifier"
},
{
"$ref": "#/components/parameters/AppDisplayName"
}
]
},
"/audio/speech": {
"post": {
"description": "Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).",
"operationId": "createAudioSpeech",
"requestBody": {
"content": {
"application/json": {
"example": {
"input": "Hello world",
"model": "elevenlabs/eleven-turbo-v2",
"response_format": "pcm",
"speed": 1,
"voice": "alloy"
},
"schema": {
"$ref": "#/components/schemas/SpeechRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"audio/*": {
"schema": {
"description": "Raw audio bytestream. Content-Type varies by requested format (audio/mpeg for mp3, audio/pcm for pcm — 16-bit little-endian).",
"example": "<binary audio data>",
"format": "binary",
"type": "string"
}
}
},
"description": "Audio bytes stream"
},
"400": {
"content": {
"application/json": {
"example": {
"error": {
"code": 400,
"message": "Invalid request parameters"
}
},
"schema": {
"$ref": "#/components/schemas/BadRequestResponse"
}
}
},
"description": "Bad Request - Invalid request parameters or malformed input"
},
"401": {
"content": {
"application/json": {
"example": {
"error": {
"code": 401,
"message": "Missing Authentication header"
}
},
"schema": {
"$ref": "#/components/schemas/UnauthorizedResponse"
}
}
},
"description": "Unauthorized - Authentication required or invalid credentials"
},
"402": {
"content": {
"application/json": {
"example": {
"error": {
"code": 402,
"message": "Insufficient credits. Add more using https://openrouter.ai/credits"
}
},
"schema": {
"$ref": "#/components/schemas/PaymentRequiredResponse"
}
}
},
"description": "Payment Required - Insufficient credits or quota to complete request"
},
"404": {
"content": {
"application/json": {
"example": {
"error": {
"code": 404,
"message": "Resource not found"
}
},
"schema": {
"$ref": "#/components/schemas/NotFoundResponse"
}
}
},
"description": "Not Found - Resource does not exist"
},
"429": {
"content": {
"application/json": {
"example": {
"error": {
"code": 429,
"message": "Rate limit exceeded"
}
},
"schema": {
"$ref": "#/components/schemas/TooManyRequestsResponse"
}
}
},
"description": "Too Many Requests - Rate limit exceeded"
},
"500": {
"content": {
"application/json": {
"example": {
"error": {
"code": 500,
"message": "Internal Server Error"
}
},
"schema": {
"$ref": "#/components/schemas/InternalServerResponse"
}
}
},
"description": "Internal Server Error - Unexpected server error"
},
"502": {
"content": {
"application/json": {
"example": {
"error": {
"code": 502,
"message": "Provider returned error"
}
},
"schema": {
"$ref": "#/components/schemas/BadGatewayResponse"
}
}
},
"description": "Bad Gateway - Provider/upstream API failure"
}
},
"summary": "Create speech",
"tags": [
"TTS"
],
"x-speakeasy-max-method-params": 1,
"x-speakeasy-name-override": "createSpeech"
},
"parameters": [
{
"$ref": "#/components/parameters/AppIdentifier"
},
{
"$ref": "#/components/parameters/AppDisplayName"
}
]
},
"/audio/transcriptions": {
"post": {
"description": "Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text.",
"operationId": "createAudioTranscriptions",
"requestBody": {
"content": {
"application/json": {
"example": {
"input_audio": {
"data": "UklGRiQA...",
"format": "wav"
},
"language": "en",
"model": "openai/whisper-large-v3"
},
"schema": {
"$ref": "#/components/schemas/STTRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"example": {
"text": "Hello, this is a test of OpenAI speech-to-text transcription.",
"usage": {
"cost": 0.000508,
"input_tokens": 83,
"output_tokens": 30,
"seconds": 9.2,
"total_tokens": 113
}
},
"schema": {
"$ref": "#/components/schemas/STTResponse"
}
}
},
"description": "Transcription result"
},
"400": {
"content": {
"application/json": {
"example": {
"error": {
"code": 400,
"message": "Invalid request parameters"
}
},
"schema": {
"$ref": "#/components/schemas/BadRequestResponse"
}
}
},
"description": "Bad Request - Invalid request parameters or malformed input"
},
"401": {
"content": {
"application/json": {
"example": {
"error": {
"code": 401,
"message": "Missing Authentication header"
}
},
"schema": {
"$ref": "#/components/schemas/UnauthorizedResponse"
}
}
},
"description": "Unauthorized - Authentication required or invalid credentials"
},
"402": {
"content": {
"application/json": {
"example": {
"error": {
"code": 402,
"message": "Insufficient credits. Add more using https://openrouter.ai/credits"
}
},
"schema": {
"$ref": "#/components/schemas/PaymentRequiredResponse"
}
}
},
"description": "Payment Required - Insufficient credits or quota to complete request"
},
"404": {
"content": {
"application/json": {
"example": {
"error": {
"code": 404,
"message": "Resource not found"
}
},
"schema": {
"$ref": "#/components/schemas/NotFoundResponse"
}
}
},
"description": "Not Found - Resource does not exist"
},
"429": {
"content": {
"application/json": {
"example": {
"error": {
"code": 429,
"message": "Rate limit exceeded"
}
},
"schema": {
"$ref": "#/components/schemas/TooManyRequestsResponse"
}
}
},
"description": "Too Many Requests - Rate limit exceeded"
},
"500": {
"content": {
"application/json": {
"example": {
"error": {
"code": 500,
"message": "Internal Server Error"
}
},
"schema": {
"$ref": "#/components/schemas/InternalServerResponse"
}
}
},
"description": "Internal Server Error - Unexpected server error"
},
"502": {
"content": {
"application/json": {
"example": {
"error": {
"code": 502,
"message": "Provider returned error"
}
},
"schema": {
"$ref": "#/components/schemas/BadGatewayResponse"
}
}
},
"description": "Bad Gateway - Provider/upstream API failure"
}
},
"summary": "Create transcription",
"tags": [
"STT"
],
"x-speakeasy-max-method-params": 1,
"x-speakeasy-name-override": "createTranscription"
},
"parameters": [
{
"$ref": "#/components/parameters/AppIdentifier"
},
{
"$ref": "#/components/parameters/AppDisplayName"
}
]
},
"/auth/keys": {
"post": {
"description": "Exchange an authorization code from the PKCE flow for a user-controlled API key",
"operationId": "exchangeAuthCodeForAPIKey",
"requestBody": {
"content": {
"application/json": {
"example": {
"code": "auth_code_abc123def456",
"code_challenge_method": "S256",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
},
"schema": {
"example": {
"code": "auth_code_abc123def456",
"code_challenge_method": "S256",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
},
"properties": {
"code": {
"description": "The authorization code received from the OAuth redirect",
"example": "auth_code_abc123def456",
"type": "string"
},
"code_challenge_method": {
"description": "The method used to generate the code challenge",
"enum": [
"S256",
"plain"
],
"example": "S256",
"nullable": true,
"type": "string",
"x-speakeasy-unknown-values": "allow"
},
"code_verifier": {
"description": "The code verifier if code_challenge was used in the authorization request",
"example": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
"type": "string"
}
},
"required": [
"code"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"example": {
"key": "sk-or-v1-REDACTED",
"user_id": "user_REDACTED"
},
"schema": {
"example": {
"key": "sk-or-v1-REDACTED",
"user_id": "user_REDACTED"
},
"properties": {
"key": {
"description": "The API key to use for OpenRouter requests",
"example": "sk-or-v1-REDACTED",
"type": "string"
},
"user_id": {
"description": "User ID associated with the API key",
"example": "user_REDACTED",
"nullable": true,
"type": "string"
}
},
"required": [
"key",
"user_id"
],
"type": "object"
}
}
},
"description": "Successfully exchanged code for an API key"
},
"400": {
"content": {
"application/json": {
"example": {
"error": {
"code": 400,
"message": "Invalid request parameters"
}
},
"schema": {
"$ref": "#/components/schemas/BadRequestResponse"
}
}
},
"description": "Bad Request - Invalid request parameters or malformed input"
},
"403": {
"content": {
"application/json": {
"example": {
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
},
"schema": {
"$ref": "#/components/schemas/ForbiddenResponse"
}
}
},
"description": "Forbidden - Authentication successful but insufficient permissions"
},
"500": {
"content": {
"application/json": {
"example": {
"error": {
"code": 500,
"message": "Internal Server Error"
}
},
"schema": {
"$ref": "#/components/schemas/InternalServerResponse"
}
}
},
"description": "Internal Server Error - Unexpected server error"
}
},
"summary": "Exchange authorization code for API key",
"tags": [
"OAuth"
]
},
"parameters": [
{
"$ref": "#/components/parameters/AppIdentifier"
},
{
"$ref": "#/components/parameters/AppDisplayName"
}
]
},
"/auth/keys/code": {
"post": {
"description": "Create an authorization code for the PKCE flow to generate a user-controlled API key",
"operationId": "createAuthKeysCode",
"requestBody": {
"content": {
"application/json": {
"example": {
"callback_url": "https://myapp.com/auth/callback",
"code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"code_challenge_method": "S256",
"limit": 100
},
"schema": {
"example": {
"callback_url": "https://myapp.com/auth/callback",
"code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"code_challenge_method": "S256",
"limit": 100
},
"properties": {
"callback_url": {
"description": "The callback URL to redirect to after authorization. Supports https URLs and localhost/127.0.0.1 URLs on any port for local CLI tools.",
"example": "https://myapp.com/auth/callback",
"format": "uri",
"type": "string"
},
"code_challenge": {
"description": "PKCE code challenge for enhanced security",
"example": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"type": "string"
},
"code_challenge_method": {
"description": "The method used to generate the code challenge",
"enum": [
"S256",
"plain"
],
"example": "S256",
"type": "string",
"x-speakeasy-unknown-values": "allow"
},
"expires_at": {
"description": "Optional expiration time for the API key to be created",
"example": "2027-12-31T23:59:59Z",
"format": "date-time",
"nullable": true,
"type": "string"
},
"key_label": {
"description": "Optional custom label for the API key. Defaults to the app name if not provided.",
"example": "My Custom Key",
"maxLength": 100,
"type": "string"
},
"limit": {
"description": "Credit limit for the API key to be created",
"example": 100,
"format": "double",
"type": "number"
},
"spawn_agent": {
"description": "Agent identifier for spawn telemetry",
"example": "my-agent",
"type": "string",
"x-fern-ignore": true,
"x-speakeasy-ignore": true
},
"spawn_cloud": {
"description": "Cloud identifier for spawn telemetry",
"example": "aws-us-east-1",
"type": "string",
"x-fern-ignore": true,
"x-speakeasy-ignore": true
}
},
"required": [
"callback_url"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"example": {
"data": {
"app_id": 12345,
"created_at": "2025-08-24T10:30:00Z",
"id": "auth_code_xyz789"
}
},
"schema": {
"example": {
"data": {
"app_id": 12345,
"created_at": "2025-08-24T10:30:00Z",
"id": "auth_code_xyz789"
}
},
"properties": {
"data": {
"description": "Auth code data",
"example": {
"app_id": 12345,
"created_at": "2025-08-24T10:30:00Z",
"id": "auth_code_xyz789"
},
"properties": {
"app_id": {
"description": "The application ID associated with this auth code",
"example": 12345,
"type": "integer"
},
"created_at": {
"description": "ISO 8601 timestamp of when the auth code was created",
"example": "2025-08-24T10:30:00Z",
"type": "string"
},
"id": {
"description": "The authorization code ID to use in the exchange request",
"example": "auth_code_xyz789",
"type": "string"
}
},
"required": [
"id",
"app_id"
],
"type": "object"
}
},
"required": [
"data"
],
"type": "object"
}
}
},
"description": "Successfully created authorization code"
},
"400": {
"content": {
"application/json": {
"example": {
"error": {
"code": 400,
"message": "Invalid request parameters"
}
},
"schema": {
"$ref": "#/components/schemas/BadRequestResponse"
}
}
},
"description": "Bad Request - Invalid request parameters or malformed input"
},
"401": {
"content": {
"application/json": {
"example": {
"error": {
"code": 401,
"message": "Missing Authentication header"
}
},
"schema": {
"$ref": "#/components/schemas/UnauthorizedResponse"
}
}
},
"description": "Unauthorized - Authentication required or invalid credentials"
},
"403": {
"content": {
"application/json": {
"example": {
"error": {
"code": 403,
"message": "Only management keys can perform this operation"
}
},
"schema": {
"$ref": "#/components/schemas/ForbiddenResponse"
}
}
},
"description": "Forbidden - Authentication successful but insufficient permissions"
},
"409": {
"content": {
"application/json": {
"example": {
"error": {
"code": 409,
"message": "Resource conflict. Please try again later."
}
},
"schema": {
"$ref": "#/components/schemas/ConflictResponse"
}
}
},
"description": "Conflict - Resource conflict or concurrent modification"
},
"500": {
"content": {
"application/json": {
"example": {
"error": {
"code": 500,
"message": "Internal Server Error"
}
},
"schema": {
"$ref": "#/components/schemas/InternalServerResponse"
}
}
},
"description": "Internal Server Error - Unexpected server error"
}
},
"summary": "Create authorization code",
"tags": [
"OAuth"
],
"x-speakeasy-name-override": "createAuthCode"
},
"parameters": [
{
"$ref": "#/components/parameters/AppIdentifier"
},
{
"$ref": "#/components/parameters/AppDisplayName"
}
]
},
"/benchmarks": {
"get": {
"description": "Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.",
"operationId": "getBenchmarks",
"parameters": [
{
"description": "Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.",
"in": "query",
"name": "source",
"required": false,
"schema": {
"description": "Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.",
"enum": [
"artificial-analysis",
"design-arena"
],
"example": "artificial-analysis",
"type": "string",
"x-speakeasy-unknown-values": "allow"
}
},
{
"description": "Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.",
"in": "query",
"name": "task_type",
"required": false,
"schema": {
"description": "Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category.",
"enum": [
"coding",
"intelligence"
],
"example": "coding",
"type": "string",
"x-speakeasy-unknown-values": "allow"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"example": {
"data": [
{
"agentic_index": 58.3,
"coding_index": 65.8,
"display_name": "GPT-4o",
"intelligence_index": 71.2,
"model_permaslug": "openai/gpt-4o",
"pricing": {
"completion": "0.00001",
"prompt": "0.0000025"
},
"source": "artificial-analysis"
}
],
"meta": {
"as_of": "2026-06-03T12:00:00Z",
"citation": null,
"model_count": 1,
"source": null,
"source_url": null,
"task_type": null,
"version": "v1"
}
},
"schema": {
"$ref": "#/components/schemas/UnifiedBenchmarksResponse"
}
}
},
"description": "Benchmark results filtered by the specified source and optional task type."
},
"400": {
"content": {
"application/json": {
"example": {
"error": {
"code": 400,
"message": "Invalid request parameters"
}
},
"schema": {
"$ref": "#/components/schemas/BadRequestResponse"
}
}
},
"description": "Bad Request - Invalid request parameters or malformed input"
},
"401": {
"content": {
"application/json": {
"example": {
"error": {
"code": 401,
"message": "Missing Authentication header"
}
},
"schema": {
"$ref": "#/components/schemas/UnauthorizedResponse"
}
}
},
"description": "Unauthorized - Authentication required or invalid credentials"
},
"429": {
"content": {
"application/json": {
"example": {
"error": {
"code": 429,
"message": "Rate limit exceeded"
}
},
"schema": {
"$ref": "#/components/schemas/TooManyRequestsResponse"
}
}
},
"description": "Too Many Requests - Rate limit exceeded"
},
"500": {
"content": {
"application/json": {
"example": {
"error": {
"code": 500,
"message": "Internal Server Error"
}
},
"schema": {
"$ref": "#/components/schemas/InternalServerResponse"
}
}
},
"description": "Internal Server Error - Unexpected server error"
}
},
"summary": "List Benchmarks",
"tags": [
"Benchmarks"
]
},
"parameters": [
{
"$ref": "#/components/parameters/AppIdentifier"
},
{
"$ref": "#/components/parameters/AppDisplayName"
}
]
}
},
"security": [
{
"apiKey": []
}
],
"servers": [
{
"description": "Production server",
"url": "https://openrouter.ai/api/v1",
"x-speakeasy-server-id": "production"
}
],
"tags": [
{
"description": "API key management endpoints",
"name": "API Keys"
},
{
"description": "Analytics and usage endpoints",
"name": "Analytics"
}
]
}curl "https://openrouter.ai/openapi.json"const res = await fetch("https://openrouter.ai/openapi.json");
const data = await res.json();
console.log(data);import requests
res = requests.get("https://openrouter.ai/openapi.json")
print(res.json())BROWSER CALLS BLOCKED (NO CORS/HTTPS) — USE THE CURL SNIPPET
/openapi.jsonPROBEDOpenRouter Models — keyless JSON API
/openapi.json?limit=5Paginated variant with limit parameter.
/activityGet user activity grouped by endpoint
/analytics/metaGet available analytics metrics and dimensions
/benchmarksList Benchmarks
/byokList BYOK provider credentials
We probe a documented GET and expect 2xx JSON — full uptime and health score. Export includes every documented route below.
Not tracked yet. Shape-change history starts once this API joins our probe schedule.
OpenRouter Models: common questions
Is OpenRouter Models free to use?
Yes — OpenRouter Models is a free developer tools API. Free tier: Free — limits not published. Whether the free tier allows commercial use is unclear — check the provider docs.
Does OpenRouter Models need an API key?
No — OpenRouter Models needs no API key or signup. You can call it straight away; rate limits still apply (Unpublished).
Can I call OpenRouter Models from the browser?
Not directly — OpenRouter Models doesn't send browser-friendly CORS headers, so call it from a server or proxy instead. Copy the curl or Python snippet on this page to get started.
Is OpenRouter Models up right now?
OpenRouter Models is catalogued but not yet on our probe schedule, so we don't publish a live status for it. Check the provider's own status page or docs for its current state.