{
    "openapi": "3.0.3",
    "info": {
        "title": "Requesty API",
        "description": "Requesty API for AI model routing and key management",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://api-v2.requesty.ai",
            "description": "Management API endpoint"
        },
        {
            "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": 3.8e-05
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                }
            }
        },
        "/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"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                }
            }
        },
        "/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"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                }
            }
        },
        "/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"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "413": {
                        "description": "Payload too large"
                    }
                }
            }
        },
        "/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"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "429": {
                        "description": "Rate limit exceeded"
                    }
                }
            }
        },
        "/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"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "413": {
                        "description": "Payload too large"
                    },
                    "429": {
                        "description": "Rate limit exceeded"
                    }
                }
            }
        },
        "/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"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - invalid API key"
                    }
                }
            }
        },
        "/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"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                }
            }
        },
        "/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"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                }
            }
        },
        "/v1/manage/apikey": {
            "servers": [
                {
                    "url": "https://api-v2.requesty.ai",
                    "description": "Management API endpoint"
                }
            ],
            "get": {
                "summary": "Get all API keys",
                "description": "Retrieve all existing API keys for the organization",
                "responses": {
                    "200": {
                        "description": "Successfully retrieved API keys",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetApiKeysResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - requires manage permission"
                    }
                }
            },
            "post": {
                "summary": "Create new API key",
                "description": "Create a new API key for the organization",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateApiKeyRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "API key created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateApiKeyResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - requires manage permission"
                    }
                }
            }
        },
        "/v1/manage/apikey/{id}": {
            "servers": [
                {
                    "url": "https://api-v2.requesty.ai",
                    "description": "Management API endpoint"
                }
            ],
            "get": {
                "summary": "Get API key",
                "description": "Get information about a specific API key. An API key can query about itself, or about other keys if it has manage read permissions.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "The UUID of the API key to retrieve, or 'self' to query the calling API key"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully retrieved API key information",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiKeyInfoResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized - invalid or missing bearer token"
                    },
                    "403": {
                        "description": "Forbidden - insufficient permissions to query this key"
                    },
                    "404": {
                        "description": "API key not found"
                    }
                }
            },
            "delete": {
                "summary": "Delete API key",
                "description": "Delete a specific API key",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "API key deleted successfully"
                    }
                }
            }
        },
        "/v1/manage/apikey/{id}/usage": {
            "servers": [
                {
                    "url": "https://api-v2.requesty.ai",
                    "description": "Management API endpoint"
                }
            ],
            "get": {
                "summary": "Get API key usage",
                "description": "Get usage statistics for a specific API key within a date range",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GetApiKeyUsageRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfully retrieved usage data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetApiKeyUsageResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/manage/apikey/{id}/limit": {
            "servers": [
                {
                    "url": "https://api-v2.requesty.ai",
                    "description": "Management API endpoint"
                }
            ],
            "post": {
                "summary": "Update API key monthly limit",
                "description": "Update the monthly spending limit for a specific API key",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateLimitRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "204": {
                        "description": "Monthly limit updated successfully"
                    }
                }
            }
        },
        "/v1/manage/apikey/{id}/label": {
            "servers": [
                {
                    "url": "https://api-v2.requesty.ai",
                    "description": "Management API endpoint"
                }
            ],
            "post": {
                "summary": "Update API key labels",
                "description": "Update labels for an API key. Setting an empty object will remove all labels.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateLabelRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "204": {
                        "description": "Labels updated successfully"
                    }
                }
            }
        },
        "/v1/manage/apikey/{id}/expiry": {
            "servers": [
                {
                    "url": "https://api-v2.requesty.ai",
                    "description": "Management API endpoint"
                }
            ],
            "post": {
                "summary": "Update API key expiry",
                "description": "Update the expiry date for an API key. If expires_at is not set or is null, the current expiry will be removed, making the API key non-expiring.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateExpiryRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "204": {
                        "description": "Expiry updated successfully"
                    },
                    "400": {
                        "description": "Bad request - API key is already expired"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - requires manage permission"
                    },
                    "404": {
                        "description": "API key not found"
                    }
                }
            }
        },
        "/v1/manage/group": {
            "servers": [
                {
                    "url": "https://api-v2.requesty.ai",
                    "description": "Management API endpoint"
                }
            ],
            "get": {
                "summary": "List groups",
                "description": "List all groups in your organization",
                "responses": {
                    "200": {
                        "description": "Successfully retrieved groups",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetGroupsResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - API key does not have manage read permissions"
                    }
                }
            },
            "post": {
                "summary": "Create group",
                "description": "Create a new group in your organization",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateGroupRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Group created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateGroupResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - invalid request body or missing required fields"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - API key does not have manage write permissions"
                    }
                }
            }
        },
        "/v1/manage/group/{id}": {
            "servers": [
                {
                    "url": "https://api-v2.requesty.ai",
                    "description": "Management API endpoint"
                }
            ],
            "get": {
                "summary": "Get group",
                "description": "Get detailed information about a specific group including its members",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "description": "The group ID",
                        "example": "123e4567-e89b-12d3-a456-426614174000"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully retrieved group",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetGroupResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - API key does not have manage read permissions"
                    },
                    "404": {
                        "description": "Group not found"
                    }
                }
            },
            "delete": {
                "summary": "Delete group",
                "description": "Delete a group from your organization",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "description": "The group ID",
                        "example": "123e4567-e89b-12d3-a456-426614174000"
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Group deleted successfully"
                    },
                    "400": {
                        "description": "Bad request - invalid group id"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - API key does not have manage write permissions or insufficient permissions to delete group"
                    },
                    "404": {
                        "description": "Group not found"
                    }
                }
            }
        },
        "/v1/manage/group/{id}/member": {
            "servers": [
                {
                    "url": "https://api-v2.requesty.ai",
                    "description": "Management API endpoint"
                }
            ],
            "post": {
                "summary": "Add group member",
                "description": "Add a member to a group in your organization. The member will be assigned the specified role.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "description": "The group ID",
                        "example": "123e4567-e89b-12d3-a456-426614174000"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AddMemberRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "204": {
                        "description": "Member added successfully"
                    },
                    "400": {
                        "description": "Bad request - invalid request body, missing required fields, or invalid role"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - API key does not have manage write permissions"
                    },
                    "404": {
                        "description": "Group not found"
                    },
                    "409": {
                        "description": "Conflict - member is already in the group"
                    }
                }
            },
            "put": {
                "summary": "Update group member",
                "description": "Update the role of a member in a group.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "description": "The group ID",
                        "example": "123e4567-e89b-12d3-a456-426614174000"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateMemberRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "204": {
                        "description": "Member updated successfully"
                    },
                    "400": {
                        "description": "Bad request - invalid request body, missing required fields, or invalid role"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - API key does not have manage write permissions"
                    },
                    "404": {
                        "description": "Group or member not found"
                    }
                }
            },
            "delete": {
                "summary": "Remove group member",
                "description": "Remove a member from a group.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "description": "The group ID",
                        "example": "123e4567-e89b-12d3-a456-426614174000"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/RemoveMemberRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "204": {
                        "description": "Member removed successfully"
                    },
                    "400": {
                        "description": "Bad request - invalid request body or missing required fields"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - API key does not have manage write permissions"
                    },
                    "404": {
                        "description": "Group or member not found"
                    }
                }
            }
        },
        "/v1/manage/org": {
            "servers": [
                {
                    "url": "https://api-v2.requesty.ai",
                    "description": "Management API endpoint"
                }
            ],
            "get": {
                "summary": "Get information about organization",
                "description": "Get information about organization",
                "responses": {
                    "200": {
                        "description": "Successfully retrieved organization info",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetOrgResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - requires manage permission"
                    }
                }
            }
        },
        "/v1/manage/org/usage": {
            "servers": [
                {
                    "url": "https://api-v2.requesty.ai",
                    "description": "Management API endpoint"
                }
            ],
            "get": {
                "summary": "Get organization usage",
                "description": "Get aggregated usage statistics for your entire organization within a date range. Supports aggregation by different time periods and optional grouping by user, model, or custom fields.",
                "parameters": [
                    {
                        "name": "start",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2025-01-01T00:00:00Z"
                        },
                        "description": "Start date in RFC3339 format (e.g., 2025-01-01T00:00:00Z). Required. The date range cannot exceed 100 days from start to end."
                    },
                    {
                        "name": "end",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2025-01-31T23:59:59Z"
                        },
                        "description": "End date in RFC3339 format (e.g., 2025-01-31T23:59:59Z). Optional. Defaults to 24 hours from start if not specified. Must be after start date. The date range cannot exceed 100 days."
                    },
                    {
                        "name": "resolution",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "hour",
                                "day",
                                "month"
                            ],
                            "default": "day"
                        },
                        "description": "Time resolution for aggregation"
                    },
                    {
                        "name": "group_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "description": "Fields to group by: group_name, group_id, member_id, member_email, user_id, api_key_id, model_requested, model_used, provider_used, is_byok, origin_title, extra.<field_name>, api_key_label.<label_key>, or group_label.<label_key>. Rows missing a requested label are grouped under \"Unknown\". Can be specified multiple times."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfully retrieved usage data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetOrgUsageResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request - invalid parameters"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden - requires manage read permission"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "BearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "API key for authentication"
            }
        },
        "schemas": {
            "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)"
                    }
                }
            },
            "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)"
                    }
                }
            },
            "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."
                    }
                }
            },
            "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"
                    }
                }
            },
            "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"
                        }
                    }
                }
            },
            "CompletionTokenDetails": {
                "type": "object",
                "properties": {
                    "reasoning_tokens": {
                        "type": "integer",
                        "format": "int32",
                        "description": "Tokens generated for reasoning."
                    }
                }
            },
            "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."
                    }
                }
            },
            "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`)."
                    }
                }
            },
            "Choice": {
                "type": "object",
                "properties": {
                    "index": {
                        "type": "integer"
                    },
                    "message": {
                        "$ref": "#/components/schemas/Message"
                    },
                    "finish_reason": {
                        "type": "string"
                    }
                }
            },
            "ApiKeyPermissions": {
                "type": "string",
                "enum": [
                    "none",
                    "read",
                    "write"
                ]
            },
            "GetApiKeyPermissions": {
                "type": "object",
                "properties": {
                    "manage": {
                        "$ref": "#/components/schemas/ApiKeyPermissions"
                    },
                    "completions": {
                        "$ref": "#/components/schemas/ApiKeyPermissions"
                    }
                },
                "required": [
                    "manage",
                    "completions"
                ]
            },
            "ApiKeyInfo": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "name": {
                        "type": "string"
                    },
                    "monthly_limit": {
                        "type": "number",
                        "format": "decimal"
                    },
                    "monthly_spend": {
                        "type": "number",
                        "format": "decimal"
                    },
                    "permissions": {
                        "$ref": "#/components/schemas/GetApiKeyPermissions"
                    },
                    "labels": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        },
                        "description": "Key-value labels for the API key"
                    },
                    "created_by": {
                        "$ref": "#/components/schemas/User"
                    },
                    "group": {
                        "$ref": "#/components/schemas/APIKeyGroupInfo",
                        "description": "Group information if the API key belongs to a group"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "monthly_limit",
                    "monthly_spend",
                    "permissions"
                ]
            },
            "APIKeyGroupInfo": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The unique identifier of the group"
                    }
                },
                "required": [
                    "id"
                ]
            },
            "User": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "email": {
                        "type": "string"
                    }
                }
            },
            "GetApiKeysResponse": {
                "type": "object",
                "properties": {
                    "keys": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ApiKeyInfo"
                        }
                    }
                },
                "required": [
                    "keys"
                ]
            },
            "CreateApiKeyRequest": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "monthly_limit": {
                        "type": "number",
                        "format": "decimal"
                    },
                    "permissions": {
                        "$ref": "#/components/schemas/GetApiKeyPermissions"
                    }
                },
                "required": [
                    "name"
                ]
            },
            "CreateApiKeyResponse": {
                "type": "object",
                "properties": {
                    "api_key_id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "api_key": {
                        "type": "string"
                    }
                },
                "required": [
                    "api_key_id",
                    "api_key"
                ]
            },
            "UpdateLimitRequest": {
                "type": "object",
                "properties": {
                    "monthly_limit": {
                        "type": "number",
                        "format": "decimal"
                    }
                },
                "required": [
                    "monthly_limit"
                ]
            },
            "UpdateLabelRequest": {
                "type": "object",
                "properties": {
                    "labels": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        },
                        "description": "Key-value pairs of labels. Empty object removes all labels."
                    }
                },
                "required": [
                    "labels"
                ]
            },
            "UpdateExpiryRequest": {
                "type": "object",
                "properties": {
                    "expires_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Expiry date in RFC3339 format (e.g., 2025-12-31T23:59:59Z). If not set or null, the current expiry will be removed, making the API key non-expiring.",
                        "example": "2025-12-31T23:59:59Z"
                    }
                }
            },
            "GetApiKeyUsageRequest": {
                "type": "object",
                "properties": {
                    "start": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Start date in RFC3339 format (e.g., 2025-01-01T00:00:00Z). Required. The date range cannot exceed 100 days from start to end.",
                        "example": "2025-01-01T00:00:00Z"
                    },
                    "end": {
                        "type": "string",
                        "format": "date-time",
                        "description": "End date in RFC3339 format (e.g., 2025-01-31T23:59:59Z). Optional. Defaults to 24 hours from start if not specified. Must be after start date. The date range cannot exceed 100 days.",
                        "example": "2025-01-31T23:59:59Z"
                    },
                    "group_by": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Fields to group by: group_name, group_id, member_id, member_email, user_id, api_key_id, model_requested, model_used, provider_used, is_byok, origin_title, extra.<field_name>, api_key_label.<label_key>, or group_label.<label_key>. Rows missing a requested label are grouped under \"Unknown\"."
                    },
                    "resolution": {
                        "type": "string",
                        "enum": [
                            "hour",
                            "day",
                            "month"
                        ],
                        "default": "day",
                        "description": "Time resolution for aggregation"
                    }
                },
                "required": [
                    "start"
                ]
            },
            "ApiKeyUsageEntry": {
                "type": "object",
                "properties": {
                    "completions_requests": {
                        "type": "integer"
                    },
                    "spend": {
                        "type": "number",
                        "format": "decimal"
                    },
                    "input_tokens": {
                        "type": "integer"
                    },
                    "output_tokens": {
                        "type": "integer"
                    },
                    "total_tokens": {
                        "type": "integer"
                    },
                    "grouped_data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ApiKeyUsageGrouped"
                        }
                    }
                }
            },
            "ApiKeyUsageGrouped": {
                "type": "object",
                "properties": {
                    "group_by_values": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "completions_requests": {
                        "type": "integer"
                    },
                    "spend": {
                        "type": "number",
                        "format": "decimal"
                    },
                    "input_tokens": {
                        "type": "integer"
                    },
                    "output_tokens": {
                        "type": "integer"
                    },
                    "total_tokens": {
                        "type": "integer"
                    }
                }
            },
            "ApiKeyInfoResponse": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "logging",
                    "monthly_spend",
                    "monthly_limit",
                    "permissions"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The unique identifier of the API key"
                    },
                    "name": {
                        "type": "string",
                        "description": "The name of the API key"
                    },
                    "logging": {
                        "type": "boolean",
                        "description": "Whether logging is enabled for this API key"
                    },
                    "monthly_spend": {
                        "type": "number",
                        "format": "decimal",
                        "description": "The amount spent by this API key in the current month"
                    },
                    "monthly_limit": {
                        "type": "number",
                        "format": "decimal",
                        "description": "The monthly spending limit for this API key (0 means unlimited)"
                    },
                    "permissions": {
                        "type": "object",
                        "properties": {
                            "manage": {
                                "type": "string",
                                "enum": [
                                    "none",
                                    "read",
                                    "write"
                                ],
                                "description": "Permission level for management operations"
                            },
                            "completions": {
                                "type": "string",
                                "enum": [
                                    "none",
                                    "read",
                                    "write"
                                ],
                                "description": "Permission level for completions operations"
                            }
                        },
                        "required": [
                            "manage",
                            "completions"
                        ]
                    },
                    "group": {
                        "$ref": "#/components/schemas/APIKeyGroupInfo",
                        "description": "Group information if the API key belongs to a group"
                    }
                }
            },
            "ApiKeyUsageResponse": {
                "type": "object",
                "properties": {
                    "completions_requests": {
                        "type": "integer"
                    },
                    "spend": {
                        "type": "number",
                        "format": "decimal"
                    }
                },
                "required": [
                    "completions_requests",
                    "spend"
                ]
            },
            "GetApiKeyUsageResponse": {
                "type": "object",
                "properties": {
                    "usage": {
                        "type": "object",
                        "additionalProperties": {
                            "$ref": "#/components/schemas/ApiKeyUsageEntry"
                        },
                        "description": "Map of period (string) to usage entry"
                    }
                },
                "required": [
                    "usage"
                ]
            },
            "GetOrgUsageResponse": {
                "type": "object",
                "properties": {
                    "usage": {
                        "type": "object",
                        "additionalProperties": {
                            "$ref": "#/components/schemas/OrgUsageEntry"
                        },
                        "description": "Map of period (string) to usage entry"
                    }
                },
                "required": [
                    "usage"
                ]
            },
            "OrgUsageEntry": {
                "type": "object",
                "properties": {
                    "completions_requests": {
                        "type": "integer",
                        "description": "Number of chat completion requests"
                    },
                    "embedding_requests": {
                        "type": "integer",
                        "description": "Number of embedding requests"
                    },
                    "image_requests": {
                        "type": "integer",
                        "description": "Number of image generation requests"
                    },
                    "speech_requests": {
                        "type": "integer",
                        "description": "Number of text-to-speech requests"
                    },
                    "transcription_requests": {
                        "type": "integer",
                        "description": "Number of speech-to-text requests"
                    },
                    "total_requests": {
                        "type": "integer",
                        "description": "Total number of requests across all modalities"
                    },
                    "spend": {
                        "type": "number",
                        "format": "decimal",
                        "description": "Total spend for the period"
                    },
                    "input_tokens": {
                        "type": "integer",
                        "description": "Total input tokens consumed"
                    },
                    "output_tokens": {
                        "type": "integer",
                        "description": "Total output tokens generated"
                    },
                    "total_tokens": {
                        "type": "integer",
                        "description": "Total tokens (input + output)"
                    },
                    "grouped_data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/OrgUsageGrouped"
                        },
                        "description": "Breakdown by the requested group_by fields. Only present when group_by is specified."
                    }
                }
            },
            "OrgUsageGrouped": {
                "type": "object",
                "properties": {
                    "group_by_values": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "Map of group_by field names to their values for this group"
                    },
                    "completions_requests": {
                        "type": "integer"
                    },
                    "embedding_requests": {
                        "type": "integer"
                    },
                    "image_requests": {
                        "type": "integer"
                    },
                    "speech_requests": {
                        "type": "integer"
                    },
                    "transcription_requests": {
                        "type": "integer"
                    },
                    "total_requests": {
                        "type": "integer"
                    },
                    "spend": {
                        "type": "number",
                        "format": "decimal"
                    },
                    "input_tokens": {
                        "type": "integer"
                    },
                    "output_tokens": {
                        "type": "integer"
                    },
                    "total_tokens": {
                        "type": "integer"
                    }
                }
            },
            "GetOrgResponse": {
                "type": "object",
                "required": [
                    "name",
                    "balance"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Name of the organization"
                    },
                    "balance": {
                        "type": "number",
                        "format": "decimal",
                        "description": "Balance of the organization"
                    }
                }
            },
            "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"
                    }
                }
            },
            "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)"
                    }
                }
            },
            "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"
                    }
                }
            },
            "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"
                    }
                }
            },
            "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."
                    }
                }
            },
            "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"
                    }
                }
            },
            "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'"
                    }
                }
            },
            "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"
                    }
                }
            },
            "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.0,
                        "default": 1.0,
                        "example": 1.0
                    },
                    "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`."
                    }
                }
            },
            "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"
                    }
                }
            },
            "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"
                    }
                ]
            },
            "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."
                            }
                        }
                    }
                }
            },
            "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."
                    }
                }
            },
            "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"
                    }
                }
            },
            "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"
                    }
                }
            },
            "AnthropicContentBlock": {
                "oneOf": [
                    {
                        "$ref": "#/components/schemas/AnthropicTextBlock"
                    },
                    {
                        "$ref": "#/components/schemas/AnthropicImageBlock"
                    },
                    {
                        "$ref": "#/components/schemas/AnthropicToolUseBlock"
                    },
                    {
                        "$ref": "#/components/schemas/AnthropicToolResultBlock"
                    }
                ]
            },
            "AnthropicTextBlock": {
                "type": "object",
                "required": [
                    "type",
                    "text"
                ],
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "text"
                        ]
                    },
                    "text": {
                        "type": "string"
                    }
                }
            },
            "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"
                    }
                }
            },
            "AnthropicToolUseBlock": {
                "type": "object",
                "required": [
                    "type",
                    "id",
                    "name",
                    "input"
                ],
                "properties": {
                    "type": {
                        "type": "string",
                        "enum": [
                            "tool_use"
                        ]
                    },
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "input": {
                        "type": "object"
                    }
                }
            },
            "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"
                    }
                }
            },
            "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"
                    }
                }
            },
            "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"
                    }
                }
            },
            "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"
                    }
                }
            },
            "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."
                    }
                }
            },
            "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."
                    }
                }
            },
            "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."
                    }
                }
            },
            "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."
                    }
                }
            },
            "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."
                    }
                }
            },
            "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."
                            }
                        }
                    }
                }
            },
            "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"
                    }
                }
            },
            "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`."
                    }
                }
            },
            "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."
                    }
                }
            },
            "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`."
                    }
                }
            },
            "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"
                    }
                }
            },
            "AddMemberRequest": {
                "type": "object",
                "required": [
                    "user_id",
                    "role"
                ],
                "properties": {
                    "user_id": {
                        "type": "string",
                        "description": "The ID of the user to add to the group",
                        "example": "user-123"
                    },
                    "role": {
                        "type": "string",
                        "enum": [
                            "admin",
                            "member"
                        ],
                        "description": "The role to assign to the member",
                        "example": "member"
                    }
                },
                "example": {
                    "user_id": "user-123",
                    "role": "member"
                }
            },
            "UpdateMemberRequest": {
                "type": "object",
                "required": [
                    "user_id",
                    "role"
                ],
                "properties": {
                    "user_id": {
                        "type": "string",
                        "description": "The ID of the user whose role should be updated",
                        "example": "user-123"
                    },
                    "role": {
                        "type": "string",
                        "enum": [
                            "admin",
                            "member"
                        ],
                        "description": "The new role to assign to the member",
                        "example": "admin"
                    }
                },
                "example": {
                    "user_id": "user-123",
                    "role": "admin"
                }
            },
            "RemoveMemberRequest": {
                "type": "object",
                "required": [
                    "user_id"
                ],
                "properties": {
                    "user_id": {
                        "type": "string",
                        "description": "The ID of the user to remove from the group",
                        "example": "user-123"
                    }
                },
                "example": {
                    "user_id": "user-123"
                }
            },
            "CreateGroupRequest": {
                "type": "object",
                "required": [
                    "name"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "The name of the group",
                        "example": "Engineering Team"
                    },
                    "monthly_limit": {
                        "type": "number",
                        "format": "double",
                        "description": "Monthly spending limit for the group. 0 means unlimited.",
                        "example": 1000.0
                    }
                },
                "example": {
                    "name": "Engineering Team",
                    "monthly_limit": 1000.0
                }
            },
            "CreateGroupResponse": {
                "type": "object",
                "properties": {
                    "group_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The ID of the created group",
                        "example": "123e4567-e89b-12d3-a456-426614174000"
                    }
                },
                "required": [
                    "group_id"
                ]
            },
            "OrganizationGroupListItem": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The group ID",
                        "example": "123e4567-e89b-12d3-a456-426614174000"
                    },
                    "organization_id": {
                        "type": "string",
                        "description": "The organization ID",
                        "example": "org-123"
                    },
                    "name": {
                        "type": "string",
                        "description": "The group name",
                        "example": "Engineering Team"
                    },
                    "members_count": {
                        "type": "integer",
                        "description": "Number of members in the group",
                        "example": 5
                    },
                    "monthly_spend": {
                        "type": "number",
                        "format": "double",
                        "description": "Current monthly spending",
                        "example": 450.25
                    },
                    "monthly_limit": {
                        "type": "number",
                        "format": "double",
                        "description": "Monthly spending limit. null means unlimited.",
                        "nullable": true,
                        "example": 1000.0
                    },
                    "created_by": {
                        "type": "string",
                        "description": "User ID who created the group",
                        "example": "user-123"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the group was created",
                        "example": "2025-01-15T10:30:00Z"
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "name",
                    "members_count",
                    "monthly_spend",
                    "created_by",
                    "created_at"
                ]
            },
            "GetGroupsResponse": {
                "type": "object",
                "properties": {
                    "groups": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/OrganizationGroupListItem"
                        },
                        "description": "List of groups"
                    }
                },
                "required": [
                    "groups"
                ]
            },
            "OrganizationGroupMember": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "The member user ID",
                        "example": "user-123"
                    },
                    "email": {
                        "type": "string",
                        "format": "email",
                        "description": "The member email",
                        "example": "user@example.com"
                    },
                    "role": {
                        "type": "string",
                        "enum": [
                            "admin",
                            "member"
                        ],
                        "description": "The member role",
                        "example": "member"
                    },
                    "monthly_limit": {
                        "type": "number",
                        "format": "double",
                        "description": "Monthly spending limit for the member",
                        "nullable": true,
                        "example": 500.0
                    },
                    "monthly_spend": {
                        "type": "number",
                        "format": "double",
                        "description": "Current monthly spending",
                        "example": 250.5
                    },
                    "rate_limit": {
                        "type": "integer",
                        "format": "int64",
                        "description": "Rate limit for the member",
                        "nullable": true,
                        "example": 100
                    },
                    "active": {
                        "type": "boolean",
                        "description": "Whether the member is active",
                        "example": true
                    }
                },
                "required": [
                    "id",
                    "email",
                    "role",
                    "monthly_spend",
                    "active"
                ]
            },
            "OrganizationGroup": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The group ID",
                        "example": "123e4567-e89b-12d3-a456-426614174000"
                    },
                    "organization_id": {
                        "type": "string",
                        "description": "The organization ID",
                        "example": "org-123"
                    },
                    "name": {
                        "type": "string",
                        "description": "The group name",
                        "example": "Engineering Team"
                    },
                    "monthly_limit": {
                        "type": "number",
                        "format": "double",
                        "description": "Monthly spending limit. null means unlimited.",
                        "nullable": true,
                        "example": 1000.0
                    },
                    "created_by": {
                        "type": "string",
                        "description": "User ID who created the group",
                        "example": "user-123"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "When the group was created",
                        "example": "2025-01-15T10:30:00Z"
                    },
                    "members": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/OrganizationGroupMember"
                        },
                        "description": "List of group members"
                    }
                },
                "required": [
                    "id",
                    "organization_id",
                    "name",
                    "created_by",
                    "created_at",
                    "members"
                ]
            },
            "GetGroupResponse": {
                "type": "object",
                "properties": {
                    "group": {
                        "$ref": "#/components/schemas/OrganizationGroup"
                    }
                },
                "required": [
                    "group"
                ]
            }
        }
    }
}
