{
  "openapi": "3.0.3",
  "info": {
    "title": "Requesty Inference API",
    "description": "Requesty Inference API for AI model routing. OpenAI-compatible endpoints for chat completions, embeddings, images, audio, and more.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://router.requesty.ai",
      "description": "Inference router endpoint"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1/chat/completions": {
      "servers": [
        {
          "url": "https://router.requesty.ai",
          "description": "Inference router endpoint"
        }
      ],
      "post": {
        "summary": "Create chat completion",
        "description": "Create a chat completion using various AI models. Compatible with the OpenAI Chat Completions format.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              },
              "example": {
                "model": "openai/gpt-4o-mini",
                "messages": [
                  {
                    "role": "system",
                    "content": "You are a helpful assistant."
                  },
                  {
                    "role": "user",
                    "content": "What is an LLM gateway?"
                  }
                ],
                "max_tokens": 1024,
                "temperature": 0.7
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Chat completion response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionResponse"
                },
                "example": {
                  "id": "chatcmpl-abc123def456",
                  "object": "chat.completion",
                  "created": 1748200000,
                  "model": "openai/gpt-4o-mini",
                  "choices": [
                    {
                      "index": 0,
                      "message": {
                        "role": "assistant",
                        "content": "An LLM gateway is a unified API layer that routes requests to multiple large language model providers. It normalizes different API formats, handles failover, load balancing, and provides centralized monitoring and cost tracking across providers like OpenAI, Anthropic, Google, and others."
                      },
                      "finish_reason": "stop"
                    }
                  ],
                  "usage": {
                    "prompt_tokens": 24,
                    "completion_tokens": 52,
                    "total_tokens": 76,
                    "cost": 0.000038
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createChatCompletion"
      }
    },
    "/v1/embeddings": {
      "servers": [
        {
          "url": "https://router.requesty.ai",
          "description": "Inference router endpoint"
        }
      ],
      "post": {
        "summary": "Create embedding",
        "description": "Create vector embeddings for text input using embedding models.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingRequest"
              },
              "example": {
                "model": "openai/text-embedding-3-small",
                "input": "Requesty is a unified LLM gateway."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Embedding response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingResponse"
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "object": "embedding",
                      "index": 0,
                      "embedding": [
                        0.0023,
                        -0.0091,
                        0.0153,
                        -0.0028,
                        0.0074
                      ]
                    }
                  ],
                  "model": "openai/text-embedding-3-small",
                  "usage": {
                    "prompt_tokens": 8,
                    "total_tokens": 8
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createEmbedding"
      }
    },
    "/v1/images/generations": {
      "servers": [
        {
          "url": "https://router.requesty.ai",
          "description": "Inference router endpoint"
        }
      ],
      "post": {
        "summary": "Create image",
        "description": "Generate images from a text prompt using image generation models",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageGenerationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image generation response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageGenerationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createImage"
      }
    },
    "/v1/images/edits": {
      "servers": [
        {
          "url": "https://router.requesty.ai",
          "description": "Inference router endpoint"
        }
      ],
      "post": {
        "summary": "Edit image",
        "description": "Edit or extend an existing image from a text prompt using image editing models. Accepts multipart/form-data (for file uploads) or application/json (with image references as base64 data URLs or file IDs).",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ImageEditMultipartRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageEditRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image edit response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageGenerationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Payload too large"
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createImageEdit"
      }
    },
    "/v1/audio/speech": {
      "servers": [
        {
          "url": "https://router.requesty.ai",
          "description": "Inference router endpoint"
        }
      ],
      "post": {
        "summary": "Create speech",
        "description": "Synthesizes audio from input text using a text-to-speech model. By default the response is a binary audio stream in the requested format. When `stream_format` is `sse`, the response is a Server-Sent Events stream of `speech.audio.delta` and `speech.audio.done` events with base64-encoded audio chunks.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpeechRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audio bytes stream (when `stream_format` is `audio`) or Server-Sent Events stream (when `stream_format` is `sse`).",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Server-Sent Events stream of `speech.audio.delta` and `speech.audio.done` events."
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createSpeech"
      }
    },
    "/v1/audio/transcriptions": {
      "servers": [
        {
          "url": "https://router.requesty.ai",
          "description": "Inference router endpoint"
        }
      ],
      "post": {
        "summary": "Create transcription",
        "description": "Transcribes audio into text using a speech-to-text model. The audio file is sent as `multipart/form-data`.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/TranscriptionMultipartRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transcription result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Payload too large"
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createTranscription"
      }
    },
    "/v1/models": {
      "servers": [
        {
          "url": "https://router.requesty.ai",
          "description": "Inference router endpoint"
        }
      ],
      "get": {
        "summary": "List available models",
        "description": "Get all available models. If authenticated with a Requesty API key, returns only approved models for your organization. Otherwise, returns all public models.",
        "security": [
          {
            "BearerAuth": []
          },
          {}
        ],
        "responses": {
          "200": {
            "description": "List of available models",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelsResponse"
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "id": "openai/gpt-4o",
                      "object": "model",
                      "created": 1715367049,
                      "owned_by": "openai"
                    },
                    {
                      "id": "anthropic/claude-sonnet-4-20250514",
                      "object": "model",
                      "created": 1715367049,
                      "owned_by": "anthropic"
                    },
                    {
                      "id": "google/gemini-2.5-pro",
                      "object": "model",
                      "created": 1715367049,
                      "owned_by": "google"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "listModels"
      }
    },
    "/v1/messages": {
      "servers": [
        {
          "url": "https://router.requesty.ai",
          "description": "Inference router endpoint"
        }
      ],
      "post": {
        "summary": "Create message",
        "description": "Send a message to an Anthropic-compatible model and receive a response",
        "security": [],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your Requesty API key"
          },
          {
            "name": "anthropic-version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "default": "2023-06-01",
              "example": "2023-06-01"
            },
            "description": "The version of the Anthropic API to use"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageRequest"
              },
              "example": {
                "model": "anthropic/claude-sonnet-4-20250514",
                "max_tokens": 1024,
                "messages": [
                  {
                    "role": "user",
                    "content": "Hello, Claude!"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                },
                "example": {
                  "id": "msg_01ABC123",
                  "type": "message",
                  "role": "assistant",
                  "content": [
                    {
                      "type": "text",
                      "text": "Hello! I'm Claude, an AI assistant by Anthropic. How can I help you today?"
                    }
                  ],
                  "model": "anthropic/claude-sonnet-4-20250514",
                  "stop_reason": "end_turn",
                  "usage": {
                    "input_tokens": 12,
                    "output_tokens": 20,
                    "cost": 0.000198
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createMessage"
      }
    },
    "/v1/responses": {
      "servers": [
        {
          "url": "https://router.requesty.ai",
          "description": "Inference router endpoint"
        }
      ],
      "post": {
        "summary": "Create response",
        "description": "Send input to an OpenAI-compatible model using the Responses API format and receive a response.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Your Requesty API key. Alternative to the standard `Authorization: Bearer` header."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesRequest"
              },
              "example": {
                "model": "openai-responses/gpt-5",
                "input": "Tell me a three sentence bedtime story about a unicorn."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesResponse"
                },
                "example": {
                  "id": "resp_abc123",
                  "object": "response",
                  "created_at": 1748200000,
                  "model": "openai-responses/gpt-5",
                  "output": [
                    {
                      "type": "message",
                      "role": "assistant",
                      "content": [
                        {
                          "type": "output_text",
                          "text": "Once upon a time, a tiny unicorn named Sparkle discovered a rainbow bridge leading to a hidden meadow. She danced under the stars with fireflies until the moon sang her a lullaby. And every night after, Sparkle dreamed of adventures yet to come."
                        }
                      ]
                    }
                  ],
                  "usage": {
                    "input_tokens": 15,
                    "output_tokens": 58,
                    "total_tokens": 73
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - malformed payload or invalid parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - missing or empty Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required - organization balance exhausted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - invalid token or model not in access list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found - provider/model not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad gateway - upstream provider returned an invalid response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "operationId": "createResponse"
      }
    }
  },
  "components": {
    "schemas": {
      "AnthropicContentBlock": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/AnthropicTextBlock"
          },
          {
            "$ref": "#/components/schemas/AnthropicImageBlock"
          },
          {
            "$ref": "#/components/schemas/AnthropicToolUseBlock"
          },
          {
            "$ref": "#/components/schemas/AnthropicToolResultBlock"
          }
        ]
      },
      "AnthropicImageBlock": {
        "type": "object",
        "required": [
          "type",
          "source"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "image"
            ]
          },
          "source": {
            "$ref": "#/components/schemas/AnthropicImageSource"
          }
        }
      },
      "AnthropicImageSource": {
        "type": "object",
        "required": [
          "type",
          "media_type",
          "data"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "base64"
            ]
          },
          "media_type": {
            "type": "string",
            "enum": [
              "image/jpeg",
              "image/png",
              "image/gif",
              "image/webp"
            ]
          },
          "data": {
            "type": "string",
            "description": "Base64 encoded image data"
          }
        }
      },
      "AnthropicMessage": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ],
            "description": "The role of the messages author"
          },
          "content": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AnthropicContentBlock"
                }
              }
            ],
            "description": "The contents of the message"
          }
        }
      },
      "AnthropicTextBlock": {
        "type": "object",
        "required": [
          "type",
          "text"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text"
            ]
          },
          "text": {
            "type": "string"
          }
        }
      },
      "AnthropicTool": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "custom",
              "web_search_20250305"
            ],
            "description": "The type of tool. Use `custom` (default, may be omitted) for user-defined tools with `name`, `description`, and `input_schema`. Use `web_search_20250305` to enable native Anthropic web search.",
            "default": "custom"
          },
          "name": {
            "type": "string",
            "description": "The tool name. Required for `custom` tools. For `web_search_20250305`, set to `web_search`."
          },
          "description": {
            "type": "string",
            "description": "For `custom` tools: describes when the model should use this tool."
          },
          "input_schema": {
            "type": "object",
            "description": "For `custom` tools: JSON schema for the tool input."
          },
          "max_uses": {
            "type": "integer",
            "description": "For `web_search_20250305`: maximum number of web searches the model may perform.",
            "minimum": 1
          }
        }
      },
      "AnthropicToolChoice": {
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "tool"
            ]
          },
          "name": {
            "type": "string"
          }
        }
      },
      "AnthropicToolResultBlock": {
        "type": "object",
        "required": [
          "type",
          "tool_use_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "tool_result"
            ]
          },
          "tool_use_id": {
            "type": "string"
          },
          "content": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/AnthropicContentBlock"
                }
              }
            ]
          },
          "is_error": {
            "type": "boolean"
          }
        }
      },
      "AnthropicToolUseBlock": {
        "type": "object",
        "required": [
          "type",
          "id",
          "name",
          "input"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "tool_use"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "input": {
            "type": "object"
          }
        }
      },
      "AnthropicUsage": {
        "type": "object",
        "required": [
          "input_tokens",
          "output_tokens"
        ],
        "properties": {
          "input_tokens": {
            "type": "integer",
            "description": "The number of input tokens which were used"
          },
          "output_tokens": {
            "type": "integer",
            "description": "The number of output tokens which were used"
          }
        }
      },
      "ChatCompletionRequest": {
        "type": "object",
        "required": [
          "messages"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "The model name. If omitted, defaults to openai/gpt-4o-mini.",
            "default": "openai/gpt-4o-mini",
            "example": "openai/gpt-4o-mini"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "description": "An array of message objects with role and content"
          },
          "max_tokens": {
            "type": "integer",
            "description": "Maximum number of tokens to generate"
          },
          "temperature": {
            "type": "number",
            "description": "Controls randomness of the output"
          },
          "top_p": {
            "type": "number",
            "description": "Controls diversity of the output"
          },
          "stream": {
            "type": "boolean",
            "description": "Enable Server-Sent Events (SSE) streaming responses"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tool"
            },
            "description": "Available tools for the model. Supports `function` tools for custom function calling and `web_search` for real-time web search."
          },
          "tool_choice": {
            "type": "string",
            "description": "Specifies how tool calling should be handled"
          },
          "response_format": {
            "type": "object",
            "description": "For structured responses (some models only)"
          }
        }
      },
      "ChatCompletionResponse": {
        "type": "object",
        "required": [
          "id",
          "object",
          "created",
          "model",
          "choices"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the completion"
          },
          "object": {
            "type": "string",
            "description": "Object type"
          },
          "created": {
            "type": "integer",
            "description": "Timestamp of creation"
          },
          "model": {
            "type": "string",
            "description": "Model used for completion"
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Choice"
            }
          }
        }
      },
      "Choice": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "message": {
            "$ref": "#/components/schemas/Message"
          },
          "finish_reason": {
            "type": "string"
          }
        }
      },
      "CompletionTokenDetails": {
        "type": "object",
        "properties": {
          "reasoning_tokens": {
            "type": "integer",
            "format": "int32",
            "description": "Tokens generated for reasoning."
          }
        }
      },
      "EmbeddingData": {
        "type": "object",
        "required": [
          "embedding",
          "index",
          "object"
        ],
        "properties": {
          "embedding": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "number",
                  "format": "float"
                },
                "description": "The embedding vector as an array of floats"
              },
              {
                "type": "string",
                "description": "The embedding vector as a base64-encoded string"
              }
            ],
            "description": "The embedding vector, the format of which is determined by the encoding_format parameter"
          },
          "index": {
            "type": "integer",
            "format": "int64",
            "description": "The index of the embedding in the list"
          },
          "object": {
            "type": "string",
            "description": "The object type, which is always 'embedding'"
          }
        }
      },
      "EmbeddingRequest": {
        "type": "object",
        "required": [
          "input",
          "model"
        ],
        "properties": {
          "input": {
            "oneOf": [
              {
                "type": "string",
                "description": "A single text string to embed"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "An array of text strings to embed"
              },
              {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int64"
                },
                "description": "An array of token integers to embed"
              },
              {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "format": "int64"
                  }
                },
                "description": "An array of token arrays to embed"
              }
            ],
            "description": "Input text to embed, encoded as a string, array of strings, array of tokens, or array of token arrays"
          },
          "model": {
            "type": "string",
            "description": "The model name to use for embedding generation",
            "example": "openai/text-embedding-3-small"
          },
          "dimensions": {
            "type": "integer",
            "format": "int64",
            "description": "The number of dimensions the resulting output embeddings should have"
          },
          "encoding_format": {
            "type": "string",
            "enum": [
              "float",
              "base64"
            ],
            "description": "The format to return the embeddings in. Can be either float or base64.",
            "default": "float"
          },
          "user": {
            "type": "string",
            "description": "A unique identifier representing your end-user."
          }
        }
      },
      "EmbeddingResponse": {
        "type": "object",
        "required": [
          "data",
          "model",
          "object",
          "usage"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmbeddingData"
            },
            "description": "The list of embeddings generated by the model"
          },
          "model": {
            "type": "string",
            "description": "The name of the model used to generate the embedding"
          },
          "object": {
            "type": "string",
            "description": "The object type, which is always 'list'"
          },
          "usage": {
            "$ref": "#/components/schemas/EmbeddingUsage"
          }
        }
      },
      "EmbeddingUsage": {
        "type": "object",
        "required": [
          "prompt_tokens",
          "total_tokens"
        ],
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "format": "int64",
            "description": "The number of tokens used by the prompt"
          },
          "total_tokens": {
            "type": "integer",
            "format": "int64",
            "description": "The total number of tokens used by the request"
          }
        }
      },
      "Function": {
        "type": "object",
        "required": [
          "name",
          "description",
          "parameters"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the function"
          },
          "description": {
            "type": "string",
            "description": "The description of the function"
          },
          "parameters": {
            "type": "object",
            "description": "The parameters schema for the function"
          }
        }
      },
      "ImageData": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "The URL of the generated image (when response_format is url)"
          },
          "b64_json": {
            "type": "string",
            "description": "The base64-encoded JSON of the generated image (when response_format is b64_json)"
          }
        }
      },
      "ImageEditMultipartRequest": {
        "type": "object",
        "required": [
          "prompt",
          "model",
          "image[]"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "The model to use for image editing",
            "example": "azure/openai/gpt-image-1"
          },
          "prompt": {
            "type": "string",
            "description": "A text description of the desired edit"
          },
          "image[]": {
            "type": "array",
            "description": "One or more image files to edit. Repeat the image[] field to upload multiple images (up to 16 for GPT image models).",
            "items": {
              "type": "string",
              "format": "binary"
            }
          },
          "size": {
            "type": "string",
            "description": "Output size. Defaults to auto.",
            "enum": [
              "auto",
              "1024x1024",
              "1536x1024",
              "1024x1536"
            ]
          },
          "quality": {
            "type": "string",
            "description": "Image quality. Defaults to auto.",
            "enum": [
              "auto",
              "high",
              "medium",
              "low"
            ]
          },
          "mask": {
            "type": "string",
            "format": "binary",
            "description": "Optional mask image file. Transparent pixels mark the area that will be regenerated."
          }
        }
      },
      "ImageEditRequest": {
        "type": "object",
        "required": [
          "prompt",
          "model",
          "images"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "The model to use for image editing",
            "example": "azure/openai/gpt-image-1"
          },
          "prompt": {
            "type": "string",
            "description": "A text description of the desired edit",
            "example": "Make the sky a dramatic sunset"
          },
          "images": {
            "type": "array",
            "description": "The list of input image references to edit. Up to 16 images for GPT image models.",
            "items": {
              "$ref": "#/components/schemas/ImageReference"
            }
          },
          "size": {
            "type": "string",
            "description": "The size of the edited images. Defaults to auto.",
            "enum": [
              "auto",
              "1024x1024",
              "1536x1024",
              "1024x1536"
            ],
            "default": "auto",
            "example": "1024x1024"
          },
          "quality": {
            "type": "string",
            "description": "The quality of the edited image. Defaults to auto.",
            "enum": [
              "auto",
              "high",
              "medium",
              "low"
            ],
            "default": "auto"
          },
          "mask": {
            "description": "Optional mask image. Transparent pixels in the mask mark the area that will be regenerated.",
            "$ref": "#/components/schemas/ImageReference"
          }
        }
      },
      "ImageGenerationRequest": {
        "type": "object",
        "required": [
          "prompt",
          "model"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "The model to use for image generation",
            "example": "azure/openai/gpt-image-1"
          },
          "prompt": {
            "type": "string",
            "description": "A text description of the desired image",
            "example": "A watercolor painting of a Japanese garden in autumn"
          },
          "n": {
            "type": "integer",
            "description": "The number of images to generate",
            "default": 1,
            "minimum": 1,
            "example": 1
          },
          "size": {
            "type": "string",
            "description": "The size of the generated images",
            "enum": [
              "1024x1024",
              "1536x1024",
              "1024x1536"
            ],
            "default": "1024x1024",
            "example": "1024x1024"
          },
          "quality": {
            "type": "string",
            "description": "The quality of the generated image",
            "enum": [
              "auto",
              "high",
              "medium",
              "low"
            ],
            "default": "auto",
            "example": "auto"
          },
          "response_format": {
            "type": "string",
            "description": "The format in which the generated images are returned",
            "enum": [
              "url",
              "b64_json"
            ],
            "default": "url",
            "example": "url"
          },
          "background": {
            "type": "string",
            "description": "The background type for the generated image",
            "enum": [
              "auto",
              "transparent",
              "opaque"
            ],
            "default": "auto",
            "example": "auto"
          },
          "output_format": {
            "type": "string",
            "description": "The file format of the generated image",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "default": "png",
            "example": "png"
          }
        }
      },
      "ImageGenerationResponse": {
        "type": "object",
        "required": [
          "created",
          "data"
        ],
        "properties": {
          "created": {
            "type": "integer",
            "description": "The Unix timestamp of when the image was created",
            "example": 1719000000
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImageData"
            },
            "description": "The list of generated images"
          }
        }
      },
      "ImageReference": {
        "type": "object",
        "description": "A reference to an input image by uploaded file ID or by URL. Provide exactly one of file_id or image_url. image_url accepts a public URL or a base64 data URL (for example data:image/png;base64,iVBORw0KGgo...).",
        "properties": {
          "file_id": {
            "type": "string",
            "description": "The File API ID of an uploaded image to use as input"
          },
          "image_url": {
            "type": "string",
            "description": "A public URL or a base64 encoded data URL for the input image"
          }
        }
      },
      "Message": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant",
              "system",
              "tool"
            ],
            "description": "The role of the message sender"
          },
          "content": {
            "type": "string",
            "description": "The content of the message"
          },
          "name": {
            "type": "string",
            "description": "The name of the tool (for tool messages)"
          }
        }
      },
      "MessageRequest": {
        "type": "object",
        "required": [
          "model",
          "max_tokens",
          "messages"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "The model to use for the completion",
            "default": "anthropic/claude-sonnet-4-20250514",
            "example": "anthropic/claude-sonnet-4-20250514"
          },
          "max_tokens": {
            "type": "integer",
            "description": "The maximum number of tokens to generate before stopping",
            "minimum": 1,
            "example": 1024
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnthropicMessage"
            },
            "description": "Input messages"
          },
          "system": {
            "type": "string",
            "description": "System prompt to be used for the completion"
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 2,
            "description": "Amount of randomness injected into the response"
          },
          "top_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Use nucleus sampling"
          },
          "top_k": {
            "type": "integer",
            "minimum": 0,
            "description": "Only sample from the top K options for each subsequent token"
          },
          "stream": {
            "type": "boolean",
            "description": "Whether to incrementally stream the response using server-sent events"
          },
          "stop_sequences": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Custom text sequences that will cause the model to stop generating"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnthropicTool"
            },
            "description": "Definitions of tools that the model may use"
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "any"
                ]
              },
              {
                "$ref": "#/components/schemas/AnthropicToolChoice"
              }
            ],
            "description": "How the model should use the provided tools"
          }
        }
      },
      "MessageResponse": {
        "type": "object",
        "required": [
          "id",
          "type",
          "role",
          "content",
          "model",
          "stop_reason",
          "usage"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique object identifier"
          },
          "type": {
            "type": "string",
            "enum": [
              "message"
            ],
            "description": "Object type"
          },
          "role": {
            "type": "string",
            "enum": [
              "assistant"
            ],
            "description": "Conversational role of the generated message"
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnthropicContentBlock"
            },
            "description": "Content generated by the model"
          },
          "model": {
            "type": "string",
            "description": "The model that handled the request"
          },
          "stop_reason": {
            "type": "string",
            "enum": [
              "end_turn",
              "max_tokens",
              "stop_sequence",
              "tool_use"
            ],
            "description": "The reason that we stopped"
          },
          "stop_sequence": {
            "type": "string",
            "description": "Which custom stop sequence was generated"
          },
          "usage": {
            "$ref": "#/components/schemas/AnthropicUsage"
          }
        }
      },
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The model identifier (e.g., 'openai/gpt-5-mini')"
          },
          "object": {
            "type": "string",
            "enum": [
              "model"
            ],
            "description": "The object type, always 'model'"
          },
          "created": {
            "type": "integer",
            "description": "The Unix timestamp (in seconds) when the model was created"
          },
          "owned_by": {
            "type": "string",
            "description": "The system or organization that owns the model",
            "example": "system"
          },
          "input_price": {
            "type": "number",
            "format": "float",
            "description": "Price per input token in USD"
          },
          "caching_price": {
            "type": "number",
            "format": "float",
            "description": "Price per token for caching in USD"
          },
          "cached_price": {
            "type": "number",
            "format": "float",
            "description": "Price per cached token in USD"
          },
          "output_price": {
            "type": "number",
            "format": "float",
            "description": "Price per output token in USD"
          },
          "max_output_tokens": {
            "type": "integer",
            "description": "Maximum number of output tokens the model can generate"
          },
          "context_window": {
            "type": "integer",
            "description": "Maximum context window size in tokens"
          },
          "supports_caching": {
            "type": "boolean",
            "description": "Whether the model supports caching"
          },
          "supports_vision": {
            "type": "boolean",
            "description": "Whether the model supports vision/image inputs"
          },
          "supports_computer_use": {
            "type": "boolean",
            "description": "Whether the model supports computer use capabilities"
          },
          "supports_reasoning": {
            "type": "boolean",
            "description": "Whether the model supports reasoning capabilities"
          },
          "supports_web_search": {
            "type": "boolean",
            "description": "Whether the model supports web search via the `web_search` tool type"
          },
          "supports_json_schema": {
            "type": "boolean",
            "description": "Whether the model supports strict structured outputs via `response_format` with `{ \"type\": \"json_schema\" }`"
          },
          "description": {
            "type": "string",
            "description": "A description of the model's capabilities and use cases"
          },
          "retires_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the model is scheduled to be retired, in ISO 8601 format. After this date, requests to the model fail. Null if no retirement is scheduled."
          }
        }
      },
      "ModelsResponse": {
        "type": "object",
        "required": [
          "object",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ],
            "description": "The object type, always 'list'"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Model"
            },
            "description": "The list of available models"
          }
        }
      },
      "PromptTokenDetails": {
        "type": "object",
        "properties": {
          "cached_tokens": {
            "type": "integer",
            "format": "int32",
            "description": "Cached tokens present in the prompt."
          },
          "caching_tokens": {
            "type": "integer",
            "format": "int32",
            "description": "Tokens that were cached following this prompt."
          }
        }
      },
      "ResponsesInputContent": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "input_text",
              "input_image",
              "input_file"
            ]
          },
          "text": {
            "type": "string",
            "description": "For `type=input_text`: the text content."
          },
          "image_url": {
            "type": "string",
            "description": "For `type=input_image`: an https:// URL or `data:` URL."
          },
          "detail": {
            "type": "string",
            "enum": [
              "low",
              "high",
              "auto"
            ],
            "description": "For `type=input_image`: image fidelity."
          },
          "filename": {
            "type": "string",
            "description": "For `type=input_file`: name of the file."
          },
          "file_data": {
            "type": "string",
            "description": "For `type=input_file`: base64 data URL, e.g. `data:application/pdf;base64,...`."
          },
          "file_url": {
            "type": "string",
            "description": "For `type=input_file`: remote URL of the file."
          },
          "mime_type": {
            "type": "string",
            "description": "For `type=input_file`: optional MIME type override."
          }
        }
      },
      "ResponsesInputItem": {
        "type": "object",
        "description": "Typed input item. Use `type=message` for chat turns, `function_call` to replay a tool call, and `function_call_output` to provide a tool result.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "message",
              "reasoning",
              "function_call",
              "function_call_output"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant",
              "system",
              "developer"
            ],
            "description": "For `type=message`: the role of the message author."
          },
          "content": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ResponsesInputContent"
                }
              }
            ],
            "description": "For `type=message`: a string or an array of typed content objects."
          },
          "name": {
            "type": "string",
            "description": "For `type=function_call`: the function name."
          },
          "arguments": {
            "type": "string",
            "description": "For `type=function_call`: JSON-encoded arguments string."
          },
          "call_id": {
            "type": "string",
            "description": "For `type=function_call` and `function_call_output`: identifier linking call and result."
          },
          "output": {
            "type": "string",
            "description": "For `type=function_call_output`: the result returned to the model."
          }
        }
      },
      "ResponsesOutputContent": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "output_text",
              "output_refusal"
            ]
          },
          "text": {
            "type": "string",
            "description": "For `type=output_text`: the generated text."
          },
          "refusal": {
            "type": "string",
            "description": "For `type=output_refusal`: the refusal message."
          }
        }
      },
      "ResponsesOutputItem": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "message",
              "reasoning",
              "function_call",
              "web_search_call"
            ]
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "in_progress",
              "completed"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "assistant"
            ],
            "description": "For `type=message`."
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponsesOutputContent"
            },
            "description": "For `type=message`: model-generated content blocks."
          },
          "summary": {
            "type": "array",
            "description": "For `type=reasoning`: optional summary of the reasoning trace."
          },
          "encrypted_content": {
            "type": "string",
            "description": "For `type=reasoning`: opaque token that can be replayed on subsequent turns."
          },
          "name": {
            "type": "string",
            "description": "For `type=function_call`: the function name."
          },
          "arguments": {
            "type": "string",
            "description": "For `type=function_call`: JSON-encoded arguments string."
          },
          "call_id": {
            "type": "string",
            "description": "For `type=function_call`: identifier to pair with a `function_call_output`."
          }
        }
      },
      "ResponsesReasoning": {
        "type": "object",
        "description": "Reasoning configuration for reasoning-capable models.",
        "properties": {
          "effort": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "description": "How much effort the model should spend on reasoning. Defaults to medium."
          },
          "summary": {
            "type": "string",
            "enum": [
              "auto",
              "concise",
              "detailed"
            ],
            "description": "Whether and how to summarize the reasoning trace."
          }
        }
      },
      "ResponsesRequest": {
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "The model to use for the response. To route OpenAI models through their native Responses API, use the `openai-responses/` prefix (e.g. `openai-responses/gpt-5`).",
            "default": "openai-responses/gpt-5",
            "example": "openai-responses/gpt-5"
          },
          "input": {
            "description": "Text, image, or file inputs to the model. Either a plain string or an array of typed input items.",
            "oneOf": [
              {
                "type": "string",
                "example": "Tell me a three sentence bedtime story about a unicorn."
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ResponsesInputItem"
                }
              }
            ]
          },
          "instructions": {
            "type": "string",
            "description": "Inserts a system (or developer) message as the first item in the model's context."
          },
          "max_output_tokens": {
            "type": "integer",
            "minimum": 1,
            "description": "Upper bound for the number of tokens that can be generated, including visible output tokens and reasoning tokens."
          },
          "stream": {
            "type": "boolean",
            "description": "If true, the response is streamed to the client as it is generated using server-sent events."
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 2,
            "description": "Sampling temperature between 0 and 2. Higher values produce more random output."
          },
          "top_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Nucleus sampling: consider tokens with cumulative probability mass up to top_p."
          },
          "parallel_tool_calls": {
            "type": "boolean",
            "description": "Whether to allow the model to run tool calls in parallel."
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "none",
                  "required"
                ]
              },
              {
                "type": "object"
              }
            ],
            "description": "Controls which (if any) tool is called by the model."
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponsesTool"
            },
            "description": "Tools the model may call."
          },
          "reasoning": {
            "$ref": "#/components/schemas/ResponsesReasoning"
          },
          "text": {
            "$ref": "#/components/schemas/ResponsesText"
          },
          "include": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Specify additional output data to include in the model response."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Set of key-value pairs that can be attached to the request."
          },
          "store": {
            "type": "boolean",
            "description": "Whether to store the generated model response for later retrieval via API."
          },
          "truncation": {
            "type": "string",
            "description": "The truncation strategy to use for the model response."
          },
          "user": {
            "type": "string",
            "description": "A unique identifier representing your end-user."
          }
        }
      },
      "ResponsesResponse": {
        "type": "object",
        "required": [
          "id",
          "object",
          "created_at",
          "model",
          "status",
          "output"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for this response."
          },
          "object": {
            "type": "string",
            "enum": [
              "response"
            ],
            "description": "Object type."
          },
          "created_at": {
            "type": "integer",
            "description": "Unix timestamp (in seconds) of when the response was created."
          },
          "model": {
            "type": "string",
            "description": "Model ID used to generate the response."
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "failed",
              "in_progress",
              "incomplete"
            ],
            "description": "Status of the response generation."
          },
          "output": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResponsesOutputItem"
            },
            "description": "Output items from the model. Typically one or more `message`, `function_call`, or `reasoning` items."
          },
          "incomplete_details": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "description": "Why the response is incomplete."
              }
            }
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          },
          "usage": {
            "$ref": "#/components/schemas/ResponsesUsage"
          }
        }
      },
      "ResponsesText": {
        "type": "object",
        "description": "Output text configuration, including structured output format.",
        "properties": {
          "format": {
            "type": "object",
            "description": "Configure the format that the model must output. Set `{ \"type\": \"json_schema\" }` for strict structured outputs, or `{ \"type\": \"text\" }` (default) for plain text.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text",
                  "json_object",
                  "json_schema"
                ]
              },
              "name": {
                "type": "string",
                "description": "For `type=json_schema`: schema name."
              },
              "strict": {
                "type": "boolean",
                "description": "For `type=json_schema`: enforce strict schema validation."
              },
              "schema": {
                "type": "object",
                "description": "For `type=json_schema`: the JSON Schema document."
              }
            }
          }
        }
      },
      "ResponsesTool": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "function",
              "web_search"
            ]
          },
          "name": {
            "type": "string",
            "description": "For `type=function`: the function name."
          },
          "description": {
            "type": "string",
            "description": "For `type=function`: a description of when to call the function."
          },
          "parameters": {
            "type": "object",
            "description": "For `type=function`: JSON Schema describing the arguments."
          },
          "strict": {
            "type": "boolean",
            "description": "For `type=function`: when true, the model must produce arguments that exactly match the schema."
          }
        }
      },
      "ResponsesUsage": {
        "type": "object",
        "required": [
          "input_tokens",
          "output_tokens",
          "total_tokens"
        ],
        "properties": {
          "input_tokens": {
            "type": "integer"
          },
          "output_tokens": {
            "type": "integer"
          },
          "total_tokens": {
            "type": "integer"
          },
          "input_tokens_details": {
            "type": "object",
            "properties": {
              "cached_tokens": {
                "type": "integer"
              }
            }
          },
          "output_tokens_details": {
            "type": "object",
            "properties": {
              "reasoning_tokens": {
                "type": "integer"
              }
            }
          },
          "cost": {
            "type": "number",
            "format": "float",
            "description": "Requesty's USD cost for this request. Returned by default on non-streaming responses. For streaming, the final `response.completed` event includes `usage` with `cost`."
          }
        }
      },
      "SpeechRequest": {
        "type": "object",
        "required": [
          "model",
          "input",
          "voice"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "The text-to-speech model to use, prefixed with the provider slug. Currently only OpenAI models are supported.",
            "example": "openai/gpt-4o-mini-tts"
          },
          "input": {
            "type": "string",
            "description": "The text to synthesize into speech. Maximum length is 4096 characters.",
            "maxLength": 4096,
            "example": "The quick brown fox jumped over the lazy dog."
          },
          "voice": {
            "type": "string",
            "description": "The voice to use when generating the audio.",
            "enum": [
              "alloy",
              "ash",
              "ballad",
              "coral",
              "echo",
              "fable",
              "onyx",
              "nova",
              "sage",
              "shimmer",
              "verse"
            ],
            "example": "alloy"
          },
          "instructions": {
            "type": "string",
            "description": "Additional steering for the voice (tone, accent, pacing). Supported by `openai/gpt-4o-mini-tts` only. Ignored by `openai/tts-1` and `openai/tts-1-hd`.",
            "example": "Speak in a warm, friendly tone."
          },
          "response_format": {
            "type": "string",
            "description": "The audio container format for the synthesized output.",
            "enum": [
              "mp3",
              "opus",
              "aac",
              "flac",
              "wav",
              "pcm"
            ],
            "default": "mp3",
            "example": "mp3"
          },
          "speed": {
            "type": "number",
            "format": "float",
            "description": "Playback speed of the generated audio. `1.0` is normal speed.",
            "minimum": 0.25,
            "maximum": 4,
            "default": 1,
            "example": 1
          },
          "stream_format": {
            "type": "string",
            "description": "Optional and not recommended for most clients. Omit this field to get the default response shape: raw audio bytes in the requested `response_format`. Set to `sse` only with `openai/gpt-4o-mini-tts` to receive a Server-Sent Events stream of `speech.audio.delta` and `speech.audio.done` events with base64-encoded audio chunks. The router rejects `sse` with `openai/tts-1` or `openai/tts-1-hd`, and rejects `audio` with `openai/gpt-4o-mini-tts`."
          }
        }
      },
      "Tool": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "function",
              "web_search"
            ],
            "description": "The type of tool. Use `function` for custom function calling, or `web_search` to enable the model to search the web for real-time information. When `type=web_search`, Requesty translates the tool to the provider's native web search format (Anthropic, Vertex/Gemini, OpenAI, xAI, Perplexity)."
          },
          "function": {
            "$ref": "#/components/schemas/Function",
            "description": "Required when `type=function`. The function definition."
          }
        }
      },
      "TranscriptionDurationUsage": {
        "type": "object",
        "required": [
          "type",
          "seconds"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "duration"
            ],
            "description": "Discriminator. Always `duration` for this variant.",
            "example": "duration"
          },
          "seconds": {
            "type": "number",
            "format": "float",
            "description": "Duration of the input audio in seconds."
          }
        }
      },
      "TranscriptionMultipartRequest": {
        "type": "object",
        "required": [
          "file",
          "model"
        ],
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "The audio file to transcribe. Supported formats are `flac`, `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `ogg`, `wav`, and `webm`. Maximum upload size is 32 MB."
          },
          "model": {
            "type": "string",
            "description": "The speech-to-text model to use, prefixed with the provider slug. Currently only OpenAI models are supported.",
            "example": "openai/gpt-4o-transcribe"
          },
          "language": {
            "type": "string",
            "description": "The language of the input audio in ISO 639-1 format (for example, `en`, `fr`, `ja`). Supplying the language improves accuracy and latency. Auto-detected when omitted."
          }
        }
      },
      "TranscriptionResponse": {
        "type": "object",
        "required": [
          "text",
          "usage"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "The transcribed text.",
            "example": "Hello, world."
          },
          "usage": {
            "$ref": "#/components/schemas/TranscriptionUsage"
          }
        }
      },
      "TranscriptionTokenUsage": {
        "type": "object",
        "required": [
          "type",
          "input_tokens",
          "output_tokens",
          "total_tokens"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "tokens"
            ],
            "description": "Discriminator. Always `tokens` for this variant.",
            "example": "tokens"
          },
          "input_tokens": {
            "type": "integer",
            "description": "Number of input tokens billed for this request."
          },
          "output_tokens": {
            "type": "integer",
            "description": "Number of output tokens generated."
          },
          "total_tokens": {
            "type": "integer",
            "description": "Total tokens used (input + output)."
          },
          "input_token_details": {
            "type": "object",
            "properties": {
              "audio_tokens": {
                "type": "integer",
                "description": "Number of audio tokens in the input."
              },
              "text_tokens": {
                "type": "integer",
                "description": "Number of text tokens in the input."
              }
            }
          }
        }
      },
      "TranscriptionUsage": {
        "type": "object",
        "description": "Usage stats for the transcription. The shape depends on how the model is billed: token-based (`gpt-4o-transcribe`, `gpt-4o-mini-transcribe`) or duration-based (`whisper-1`).",
        "oneOf": [
          {
            "$ref": "#/components/schemas/TranscriptionTokenUsage"
          },
          {
            "$ref": "#/components/schemas/TranscriptionDurationUsage"
          }
        ]
      },
      "Usage": {
        "type": "object",
        "properties": {
          "completion_tokens": {
            "type": "integer",
            "format": "int32",
            "description": "Number of tokens in the generated completion."
          },
          "completion_tokens_details": {
            "$ref": "#/components/schemas/CompletionTokenDetails"
          },
          "prompt_tokens": {
            "type": "integer",
            "format": "int32",
            "description": "Number of tokens in the prompt."
          },
          "prompt_tokens_details": {
            "$ref": "#/components/schemas/PromptTokenDetails"
          },
          "total_tokens": {
            "type": "integer",
            "format": "int32",
            "description": "Total number of tokens used (prompt + completion)."
          },
          "cost": {
            "type": "number",
            "format": "double",
            "description": "Requesty's USD cost for this request. Returned by default on non-streaming responses. For streaming, pass `stream_options: {\"include_usage\": true}` to receive a final chunk with `usage` (including `cost`)."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "origin",
              "message"
            ],
            "properties": {
              "origin": {
                "type": "string",
                "enum": [
                  "router",
                  "provider"
                ],
                "description": "Whether the error originated from Requesty's router or an upstream provider."
              },
              "message": {
                "type": "string",
                "description": "Human-readable error description."
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key for authentication"
      }
    }
  }
}