{
  "openapi": "3.1.0",
  "info": {
    "title": "UltraGPT API",
    "version": "2026-10-02",
    "description": "OpenAI- and Anthropic-compatible API for every model on UltraGPT. Billed per request from your prepaid credit balance. Docs: https://developers.ultragpt.pro/docs",
    "license": {
      "name": "Proprietary - UltraGPT API Terms",
      "url": "https://developers.ultragpt.pro/legal/terms"
    },
    "contact": {
      "name": "UltraGPT developer support",
      "url": "https://developers.ultragpt.pro/support",
      "email": "support@ultragpt.pro"
    }
  },
  "servers": [
    {
      "url": "https://api.ultragpt.pro/v1"
    }
  ],
  "security": [
    {
      "bearer": []
    },
    {
      "apiKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "ugpt_live_... / ugpt_test_..."
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 255
        },
        "description": "Retrying with the same key within 24h replays the first response (streams included, up to 2MB) instead of running and billing the request again. Keys are dropped after a 5xx so the retry runs."
      },
      "XTitle": {
        "name": "X-Title",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Your app's name; shown in usage analytics and GET /generation."
      },
      "HttpReferer": {
        "name": "HTTP-Referer",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "Your app's URL; shown in usage analytics. Also checked against a key's allowed_referrers."
      },
      "CacheEnable": {
        "name": "X-UltraGPT-Cache",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "true",
            "false"
          ]
        },
        "description": "Serve identical requests from the response cache (also accepted as X-OpenRouter-Cache)."
      },
      "CacheTtl": {
        "name": "X-UltraGPT-Cache-TTL",
        "in": "header",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 86400
        }
      },
      "CacheClear": {
        "name": "X-UltraGPT-Cache-Clear",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "true",
            "false"
          ]
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Error (OpenAI shape)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "AnthropicError": {
        "description": "Error (Anthropic shape)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AnthropicError"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limited (key RPM/TPM/concurrency, or the account ceiling across keys)",
        "headers": {
          "retry-after": {
            "$ref": "#/components/headers/RetryAfter"
          },
          "x-ratelimit-limit-requests": {
            "$ref": "#/components/headers/RateLimitLimitRequests"
          },
          "x-ratelimit-remaining-requests": {
            "$ref": "#/components/headers/RateLimitRemainingRequests"
          },
          "x-ratelimit-reset-requests": {
            "$ref": "#/components/headers/RateLimitResetRequests"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "KeyLimits": {
        "type": "object",
        "properties": {
          "limit": {
            "type": [
              "number",
              "null"
            ]
          },
          "limit_reset": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "daily",
              "weekly",
              "monthly",
              "never",
              null
            ]
          },
          "limit_remaining": {
            "type": [
              "number",
              "null"
            ]
          },
          "limit_resets_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "usage": {
            "type": [
              "number",
              "null"
            ],
            "description": "Lifetime spend (USD)"
          },
          "usage_daily": {
            "type": [
              "number",
              "null"
            ]
          },
          "usage_weekly": {
            "type": [
              "number",
              "null"
            ]
          },
          "usage_monthly": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      },
      "Video": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "video_66f..."
          },
          "object": {
            "type": "string",
            "enum": [
              "video"
            ]
          },
          "model": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "in_progress",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "progress": {
            "type": "integer"
          },
          "created_at": {
            "type": "integer"
          },
          "completed_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "prompt": {
            "type": "string"
          },
          "seconds": {
            "type": "string"
          },
          "aspect_ratio": {
            "type": "string"
          },
          "resolution": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Direct MP4 URL once completed"
          },
          "thumbnail_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "usage": {
            "type": "object",
            "properties": {
              "cost": {
                "type": "number"
              },
              "estimated_cost": {
                "type": "number"
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "param": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "message",
              "type"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "AnthropicError": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "error"
          },
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "message"
            ]
          }
        },
        "required": [
          "type",
          "error"
        ]
      },
      "Usage": {
        "type": "object",
        "properties": {
          "prompt_tokens": {
            "type": "integer"
          },
          "completion_tokens": {
            "type": "integer"
          },
          "total_tokens": {
            "type": "integer"
          },
          "prompt_tokens_details": {
            "type": "object",
            "properties": {
              "cached_tokens": {
                "type": "integer"
              }
            }
          },
          "completion_tokens_details": {
            "type": "object",
            "properties": {
              "reasoning_tokens": {
                "type": "integer"
              }
            }
          },
          "cost": {
            "type": "number",
            "description": "USD billed for this request."
          }
        },
        "required": [
          "prompt_tokens",
          "completion_tokens",
          "total_tokens"
        ]
      },
      "ToolCall": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "const": "function"
          },
          "function": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "arguments": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "arguments"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "function"
        ]
      },
      "ChatMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "assistant"
            ]
          },
          "content": {
            "type": [
              "string",
              "null"
            ]
          },
          "reasoning": {
            "type": [
              "string",
              "null"
            ]
          },
          "refusal": {
            "type": [
              "string",
              "null"
            ]
          },
          "tool_calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolCall"
            }
          },
          "annotations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "role",
          "content"
        ]
      },
      "ChatCompletion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "chat.completion"
          },
          "created": {
            "type": "integer"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "message": {
                  "$ref": "#/components/schemas/ChatMessage"
                },
                "finish_reason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "stop",
                    "length",
                    "tool_calls",
                    "content_filter",
                    null
                  ]
                },
                "logprobs": {
                  "type": [
                    "object",
                    "null"
                  ]
                }
              },
              "required": [
                "index",
                "message",
                "finish_reason"
              ]
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        },
        "required": [
          "id",
          "object",
          "created",
          "model",
          "choices"
        ]
      },
      "ChatCompletionChunk": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "chat.completion.chunk"
          },
          "created": {
            "type": "integer"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "delta": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string"
                    },
                    "content": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reasoning": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tool_calls": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "finish_reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "index",
                "delta"
              ]
            }
          },
          "usage": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Usage"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "object",
          "created",
          "model",
          "choices"
        ],
        "description": "One `data:` event of a streamed chat completion. The stream ends with `data: [DONE]`; the last chunk before it carries `usage`."
      },
      "Completion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "text_completion"
          },
          "created": {
            "type": "integer"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "text": {
                  "type": "string"
                },
                "finish_reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "index",
                "text"
              ]
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        },
        "required": [
          "id",
          "object",
          "created",
          "model",
          "choices"
        ]
      },
      "AnthropicMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "const": "message"
          },
          "role": {
            "type": "string",
            "const": "assistant"
          },
          "model": {
            "type": "string"
          },
          "content": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "text",
                    "thinking",
                    "tool_use"
                  ]
                },
                "text": {
                  "type": "string"
                },
                "thinking": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "input": {
                  "type": "object"
                }
              },
              "required": [
                "type"
              ]
            }
          },
          "stop_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "end_turn",
              "max_tokens",
              "stop_sequence",
              "tool_use",
              null
            ]
          },
          "stop_sequence": {
            "type": [
              "string",
              "null"
            ]
          },
          "usage": {
            "type": "object",
            "properties": {
              "input_tokens": {
                "type": "integer"
              },
              "output_tokens": {
                "type": "integer"
              },
              "cache_read_input_tokens": {
                "type": "integer"
              },
              "cache_creation_input_tokens": {
                "type": "integer"
              }
            },
            "required": [
              "input_tokens",
              "output_tokens"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "role",
          "model",
          "content",
          "stop_reason",
          "usage"
        ]
      },
      "TokenCount": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer"
          }
        },
        "required": [
          "input_tokens"
        ]
      },
      "Response": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "response"
          },
          "created_at": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "incomplete",
              "failed",
              "in_progress"
            ]
          },
          "model": {
            "type": "string"
          },
          "output": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "message / function_call / reasoning items"
            }
          },
          "output_text": {
            "type": "string"
          },
          "previous_response_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "usage": {
            "type": "object",
            "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"
                  }
                }
              }
            }
          }
        },
        "required": [
          "id",
          "object",
          "created_at",
          "status",
          "model",
          "output"
        ]
      },
      "ResponseInputItemList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "EmbeddingList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string",
                  "const": "embedding"
                },
                "index": {
                  "type": "integer"
                },
                "embedding": {
                  "oneOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "float array, or base64 when encoding_format=base64"
                }
              },
              "required": [
                "object",
                "index",
                "embedding"
              ]
            }
          },
          "model": {
            "type": "string"
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer"
              },
              "total_tokens": {
                "type": "integer"
              },
              "cost": {
                "type": "number"
              }
            }
          }
        },
        "required": [
          "object",
          "data",
          "model"
        ]
      },
      "ImagesResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "b64_json": {
                  "type": "string"
                },
                "revised_prompt": {
                  "type": "string"
                },
                "media_type": {
                  "type": "string",
                  "description": "e.g. image/png, image/webp"
                }
              }
            }
          },
          "usage": {
            "type": "object"
          },
          "aspect_ratio": {
            "type": "string",
            "description": "Echo of the option this request ran with (absent = provider default)."
          },
          "resolution": {
            "type": "string",
            "description": "Echo of the option this request ran with (absent = provider default)."
          },
          "size": {
            "type": "string",
            "description": "Echo of the option this request ran with (absent = provider default)."
          },
          "quality": {
            "type": "string",
            "description": "Echo of the option this request ran with (absent = provider default)."
          },
          "background": {
            "type": "string",
            "description": "Echo of the option this request ran with (absent = provider default)."
          },
          "output_format": {
            "type": "string",
            "description": "Echo of the option this request ran with (absent = provider default)."
          },
          "output_compression": {
            "type": "integer"
          },
          "seed": {
            "type": "integer"
          }
        },
        "required": [
          "created",
          "data"
        ]
      },
      "Transcription": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "duration": {
            "type": "number"
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "words": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "text"
        ],
        "description": "`json`/`verbose_json` shape; `text`, `srt` and `vtt` formats return text/plain."
      },
      "Rerank": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "rerank"
          },
          "model": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "relevance_score": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "document": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string"
                    }
                  }
                }
              },
              "required": [
                "index",
                "relevance_score"
              ]
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "total_tokens": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "search_units": {
                "type": "integer"
              },
              "cost": {
                "type": "number"
              }
            }
          }
        },
        "required": [
          "id",
          "object",
          "model",
          "results",
          "usage"
        ]
      },
      "Moderation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "flagged": {
                  "type": "boolean"
                },
                "categories": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  }
                },
                "category_scores": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "required": [
          "id",
          "model",
          "results"
        ]
      },
      "SearchResults": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "search"
          },
          "model": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "snippet": {
                  "type": "string"
                },
                "content": {
                  "type": "string"
                },
                "date": {
                  "type": "string"
                }
              },
              "required": [
                "title",
                "url",
                "snippet"
              ]
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "queries": {
                "type": "integer"
              },
              "cost": {
                "type": "number"
              }
            },
            "required": [
              "queries",
              "cost"
            ]
          }
        },
        "required": [
          "id",
          "object",
          "model",
          "results",
          "usage"
        ]
      },
      "FileObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "file"
          },
          "bytes": {
            "type": "integer"
          },
          "created_at": {
            "type": "integer"
          },
          "filename": {
            "type": "string"
          },
          "purpose": {
            "type": "string",
            "enum": [
              "batch",
              "batch_output"
            ]
          },
          "status": {
            "type": "string",
            "const": "processed"
          },
          "status_details": {
            "type": "null"
          }
        },
        "required": [
          "id",
          "object",
          "bytes",
          "created_at",
          "filename",
          "purpose"
        ]
      },
      "FileList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileObject"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "Batch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "batch"
          },
          "endpoint": {
            "type": "string",
            "enum": [
              "/v1/chat/completions",
              "/v1/embeddings"
            ]
          },
          "errors": {
            "type": [
              "object",
              "null"
            ]
          },
          "input_file_id": {
            "type": "string"
          },
          "completion_window": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "validating",
              "in_progress",
              "finalizing",
              "completed",
              "failed",
              "expired",
              "cancelling",
              "cancelled"
            ]
          },
          "output_file_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "error_file_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "in_progress_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "expires_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "finalizing_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "completed_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "failed_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "expired_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cancelling_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "cancelled_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "request_counts": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "completed": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              }
            }
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ]
          },
          "usage": {
            "type": "object",
            "properties": {
              "cost": {
                "type": "number"
              }
            }
          }
        },
        "required": [
          "id",
          "object",
          "endpoint",
          "input_file_id",
          "status",
          "created_at"
        ]
      },
      "BatchList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Batch"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "DeletedObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id",
          "object",
          "deleted"
        ]
      },
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "model"
          },
          "created": {
            "type": "integer"
          },
          "owned_by": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "chat",
              "embedding",
              "image",
              "transcription",
              "speech",
              "rerank",
              "moderation",
              "search",
              "video",
              "realtime"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ]
          },
          "context_length": {
            "type": [
              "integer",
              "null"
            ]
          },
          "architecture": {
            "type": "object",
            "properties": {
              "input_modalities": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "output_modalities": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "pricing": {
            "type": "object",
            "properties": {
              "input": {
                "type": "number",
                "description": "USD per 1M input tokens"
              },
              "cached_input": {
                "type": "number"
              },
              "output": {
                "type": "number"
              },
              "prompt": {
                "type": "string",
                "description": "USD per input token (OpenRouter shape)"
              },
              "completion": {
                "type": "string"
              },
              "input_cache_read": {
                "type": "string"
              },
              "image": {
                "type": "number"
              },
              "request": {
                "type": "number"
              },
              "per_second": {
                "type": "number"
              },
              "audio_input": {
                "type": "number"
              },
              "audio_cached_input": {
                "type": "number"
              },
              "audio_output": {
                "type": "number"
              }
            },
            "required": [
              "input",
              "output",
              "prompt",
              "completion"
            ]
          },
          "supported_parameters": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "capabilities": {
            "type": "object",
            "properties": {
              "tools": {
                "type": "boolean"
              },
              "vision": {
                "type": "boolean"
              },
              "reasoning": {
                "type": "boolean"
              }
            }
          },
          "speech": {
            "type": "object"
          },
          "video": {
            "type": "object"
          },
          "deprecation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "deprecated_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "sunset_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "replacement": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "available",
              "degraded",
              "deprecated"
            ]
          },
          "images": {
            "type": "object",
            "description": "Image models: the generation options this model accepts (empty list = not supported).",
            "properties": {
              "aspect_ratios": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "resolutions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "sizes": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "WxH presets for `size`."
              },
              "custom_size": {
                "type": "boolean",
                "description": "Any WIDTHxHEIGHT `size` is accepted."
              },
              "qualities": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "backgrounds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "output_formats": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "output_compression": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "min": {
                    "type": "integer"
                  },
                  "max": {
                    "type": "integer"
                  }
                }
              },
              "moderation": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "seed": {
                "type": "boolean"
              },
              "max_input_images": {
                "type": "integer",
                "description": "Reference images per request (0 = text-to-image only)."
              },
              "supports_image_input": {
                "type": "boolean"
              },
              "n": {
                "type": "object",
                "properties": {
                  "min": {
                    "type": "integer"
                  },
                  "max": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "required": [
          "id",
          "object",
          "created",
          "owned_by",
          "type",
          "pricing"
        ]
      },
      "ModelList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Model"
            }
          }
        },
        "required": [
          "object",
          "data"
        ]
      },
      "ModelCount": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer"
              }
            },
            "required": [
              "count"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "CurrentKey": {
        "type": "object",
        "properties": {
          "data": {
            "allOf": [
              {
                "$ref": "#/components/schemas/KeyLimits"
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "prefix": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "live",
                      "test"
                    ]
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "full",
                      "read_only",
                      "management"
                    ]
                  },
                  "organization_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "rate_limit": {
                    "type": "object",
                    "properties": {
                      "requests_per_minute": {
                        "type": "integer"
                      },
                      "tokens_per_minute": {
                        "type": "integer"
                      },
                      "concurrent_requests": {
                        "type": "integer"
                      }
                    }
                  },
                  "daily_spend_limit_usd": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "day_spend_usd": {
                    "type": "number"
                  },
                  "allowed_models": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "string"
                    }
                  },
                  "allowed_ips": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "string"
                    }
                  },
                  "allowed_referrers": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "string"
                    }
                  },
                  "monthly_spend_cap_usd": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "month_spend_usd": {
                    "type": "number"
                  },
                  "expires_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "id",
                  "name",
                  "environment",
                  "scope",
                  "rate_limit"
                ]
              }
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "Credits": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "balance_usd": {
                "type": "number"
              },
              "total_credits_usd": {
                "type": "number"
              },
              "total_usage_usd": {
                "type": "number"
              }
            },
            "required": [
              "balance_usd",
              "total_credits_usd",
              "total_usage_usd"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "Generation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "model": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "key_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "key_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "playground": {
            "type": "boolean"
          },
          "batch": {
            "type": "boolean"
          },
          "streamed": {
            "type": "boolean"
          },
          "finish_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "tokens_prompt": {
            "type": "integer"
          },
          "tokens_completion": {
            "type": "integer"
          },
          "tokens_cached": {
            "type": "integer"
          },
          "tokens_reasoning": {
            "type": "integer"
          },
          "total_cost": {
            "type": "number",
            "description": "USD billed"
          },
          "latency_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "ttft_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "app": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "title": {
                "type": "string"
              },
              "referer": {
                "type": "string"
              }
            }
          },
          "fallback_from": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "web_searches": {
            "type": "integer"
          },
          "byok": {
            "type": [
              "string",
              "null"
            ]
          },
          "usage_estimated": {
            "type": "boolean"
          },
          "upstream_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "actor_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "end_user": {
            "type": [
              "string",
              "null"
            ]
          },
          "client_request_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "preset": {
            "type": [
              "string",
              "null"
            ]
          },
          "variant": {
            "type": [
              "string",
              "null"
            ]
          },
          "cache_hit": {
            "type": "boolean"
          },
          "cache_source_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "list_cost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Normal price of the request when a usage package paid part of it (total_cost is what was billed)."
          },
          "pack_covered_cost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Part of list_cost covered by a usage package."
          },
          "zero_completion_insurance": {
            "type": "boolean"
          },
          "compressed_messages": {
            "type": "integer"
          },
          "healed": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "created_at",
          "model",
          "endpoint",
          "total_cost"
        ]
      },
      "GenerationResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Generation"
          }
        },
        "required": [
          "data"
        ]
      },
      "GenerationLookup": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Generation"
            }
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "summary": {
            "type": "object",
            "properties": {
              "requested": {
                "type": "integer"
              },
              "found": {
                "type": "integer"
              },
              "total_cost": {
                "type": "number"
              }
            }
          }
        },
        "required": [
          "data",
          "missing",
          "summary"
        ]
      },
      "Activity": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "endpoint": {
                  "type": "string"
                },
                "requests": {
                  "type": "integer"
                },
                "prompt_tokens": {
                  "type": "integer"
                },
                "completion_tokens": {
                  "type": "integer"
                },
                "reasoning_tokens": {
                  "type": "integer"
                },
                "cached_tokens": {
                  "type": "integer"
                },
                "usage": {
                  "type": "number",
                  "description": "USD"
                }
              },
              "required": [
                "date",
                "model",
                "endpoint",
                "requests",
                "usage"
              ]
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "Preset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "preset"
          },
          "slug": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "config": {
            "type": "object"
          },
          "version": {
            "type": "integer"
          },
          "organization_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "versions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "version": {
                  "type": "integer"
                },
                "config": {
                  "type": "object"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "created_by": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "id",
          "object",
          "slug",
          "reference",
          "name",
          "config",
          "version"
        ]
      },
      "PresetList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Preset"
            }
          }
        },
        "required": [
          "object",
          "data"
        ]
      },
      "ManagedKey": {
        "allOf": [
          {
            "$ref": "#/components/schemas/KeyLimits"
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "project": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "environment": {
                "type": "string",
                "enum": [
                  "live",
                  "test"
                ]
              },
              "scope": {
                "type": "string",
                "enum": [
                  "full",
                  "read_only",
                  "management"
                ]
              },
              "disabled": {
                "type": "boolean"
              },
              "allowed_models": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "allowed_ips": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "allowed_referrers": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "rpm_limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "tpm_limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "last_used_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "revoked_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "name",
              "environment",
              "scope",
              "disabled"
            ]
          }
        ]
      },
      "ManagedKeyResponse": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ManagedKey"
          }
        },
        "required": [
          "data"
        ]
      },
      "ManagedKeyList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedKey"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "CreatedKey": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ManagedKey"
          },
          "key": {
            "type": "string",
            "description": "The secret. Returned only here - store it now."
          }
        },
        "required": [
          "data",
          "key"
        ]
      },
      "DeletedKey": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "deleted": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "id",
              "deleted"
            ]
          }
        },
        "required": [
          "data"
        ]
      },
      "VideoList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Video"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean"
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      }
    },
    "headers": {
      "RateLimitLimitRequests": {
        "schema": {
          "type": "integer"
        },
        "description": "Requests per minute allowed for this key."
      },
      "RateLimitRemainingRequests": {
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitResetRequests": {
        "schema": {
          "type": "string"
        },
        "description": "e.g. `23s`"
      },
      "GenerationId": {
        "schema": {
          "type": "string"
        },
        "description": "Look the request up with GET /generation?id=."
      },
      "IgnoredParams": {
        "schema": {
          "type": "string"
        },
        "description": "Comma-separated request params this model ignored."
      },
      "RetryAfter": {
        "schema": {
          "type": "integer"
        }
      }
    }
  },
  "paths": {
    "/chat/completions": {
      "post": {
        "summary": "Create a chat completion",
        "tags": [
          "Chat"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletion"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Server-sent events: `data: <ChatCompletionChunk JSON>` lines, then `data: [DONE]`.",
                  "contentMediaType": "application/json",
                  "contentSchema": {
                    "$ref": "#/components/schemas/ChatCompletionChunk"
                  }
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              },
              "x-ultragpt-generation-id": {
                "$ref": "#/components/headers/GenerationId"
              },
              "x-ultragpt-ignored-params": {
                "$ref": "#/components/headers/IgnoredParams"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Model id; append :online for web search"
                  },
                  "models": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "stream_options": {
                    "type": "object"
                  },
                  "max_tokens": {
                    "type": "integer"
                  },
                  "max_completion_tokens": {
                    "type": "integer"
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "top_p": {
                    "type": "number"
                  },
                  "top_k": {
                    "type": "integer"
                  },
                  "stop": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "seed": {
                    "type": "integer"
                  },
                  "presence_penalty": {
                    "type": "number"
                  },
                  "frequency_penalty": {
                    "type": "number"
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "tool_choice": {},
                  "parallel_tool_calls": {
                    "type": "boolean"
                  },
                  "response_format": {
                    "type": "object"
                  },
                  "reasoning": {
                    "type": "object"
                  },
                  "reasoning_effort": {
                    "type": "string"
                  },
                  "plugins": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "provider": {
                    "type": "object"
                  },
                  "user": {
                    "type": "string"
                  },
                  "safety_identifier": {
                    "type": "string",
                    "maxLength": 256,
                    "description": "Stable, hashed id of your end user; recorded on the generation (GET /generation `end_user`). Preferred over the deprecated `user`."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/XTitle"
          },
          {
            "$ref": "#/components/parameters/HttpReferer"
          },
          {
            "$ref": "#/components/parameters/CacheEnable"
          },
          {
            "$ref": "#/components/parameters/CacheTtl"
          },
          {
            "$ref": "#/components/parameters/CacheClear"
          }
        ],
        "operationId": "createChatCompletion"
      }
    },
    "/messages": {
      "post": {
        "summary": "Create a message (Anthropic Messages API)",
        "tags": [
          "Chat"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnthropicMessage"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Anthropic message stream events"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              },
              "x-ultragpt-generation-id": {
                "$ref": "#/components/headers/GenerationId"
              },
              "x-ultragpt-ignored-params": {
                "$ref": "#/components/headers/IgnoredParams"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/AnthropicError"
          },
          "5XX": {
            "$ref": "#/components/responses/AnthropicError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "max_tokens",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "max_tokens": {
                    "type": "integer"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "system": {},
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "tool_choice": {
                    "type": "object"
                  },
                  "thinking": {
                    "type": "object"
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "top_p": {
                    "type": "number"
                  },
                  "top_k": {
                    "type": "integer"
                  },
                  "stop_sequences": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "metadata": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "operationId": "createMessage",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/XTitle"
          },
          {
            "$ref": "#/components/parameters/HttpReferer"
          }
        ]
      }
    },
    "/messages/count_tokens": {
      "post": {
        "summary": "Estimate prompt tokens",
        "tags": [
          "Chat"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenCount"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/AnthropicError"
          },
          "5XX": {
            "$ref": "#/components/responses/AnthropicError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "system": {},
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "countMessageTokens"
      }
    },
    "/responses": {
      "post": {
        "summary": "Create a response (OpenAI Responses API)",
        "tags": [
          "Chat"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Responses API stream events"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              },
              "x-ultragpt-generation-id": {
                "$ref": "#/components/headers/GenerationId"
              },
              "x-ultragpt-ignored-params": {
                "$ref": "#/components/headers/IgnoredParams"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {},
                  "instructions": {
                    "type": "string"
                  },
                  "previous_response_id": {
                    "type": "string"
                  },
                  "store": {
                    "type": "boolean"
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "max_output_tokens": {
                    "type": "integer"
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "tool_choice": {},
                  "text": {
                    "type": "object"
                  },
                  "reasoning": {
                    "type": "object"
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "top_p": {
                    "type": "number"
                  },
                  "safety_identifier": {
                    "type": "string",
                    "maxLength": 256,
                    "description": "Stable, hashed id of your end user; recorded on the generation (GET /generation `end_user`). Preferred over the deprecated `user`."
                  }
                }
              }
            }
          }
        },
        "operationId": "createResponse",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/XTitle"
          },
          {
            "$ref": "#/components/parameters/HttpReferer"
          }
        ]
      }
    },
    "/responses/{id}": {
      "get": {
        "summary": "Retrieve a stored response",
        "tags": [
          "Chat"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Response"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getResponse"
      },
      "delete": {
        "summary": "Delete a stored response",
        "tags": [
          "Chat"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedObject"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "deleteResponse"
      }
    },
    "/responses/{id}/input_items": {
      "get": {
        "summary": "List a response's input items",
        "tags": [
          "Chat"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseInputItemList"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "listResponseInputItems"
      }
    },
    "/completions": {
      "post": {
        "summary": "Create a text completion (legacy)",
        "tags": [
          "Chat"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Completion"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              },
              "x-ultragpt-generation-id": {
                "$ref": "#/components/headers/GenerationId"
              },
              "x-ultragpt-ignored-params": {
                "$ref": "#/components/headers/IgnoredParams"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "prompt"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "max_tokens": {
                    "type": "integer"
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "echo": {
                    "type": "boolean"
                  },
                  "safety_identifier": {
                    "type": "string",
                    "maxLength": 256,
                    "description": "Stable, hashed id of your end user; recorded on the generation (GET /generation `end_user`). Preferred over the deprecated `user`."
                  }
                }
              }
            }
          }
        },
        "operationId": "createCompletion",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/XTitle"
          },
          {
            "$ref": "#/components/parameters/HttpReferer"
          }
        ]
      }
    },
    "/embeddings": {
      "post": {
        "summary": "Create embeddings",
        "tags": [
          "Embeddings"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingList"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              },
              "x-ultragpt-generation-id": {
                "$ref": "#/components/headers/GenerationId"
              },
              "x-ultragpt-ignored-params": {
                "$ref": "#/components/headers/IgnoredParams"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {},
                  "dimensions": {
                    "type": "integer"
                  },
                  "encoding_format": {
                    "enum": [
                      "float",
                      "base64"
                    ]
                  }
                }
              }
            }
          }
        },
        "operationId": "createEmbedding",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/XTitle"
          },
          {
            "$ref": "#/components/parameters/HttpReferer"
          }
        ]
      }
    },
    "/images/generations": {
      "post": {
        "summary": "Generate images",
        "tags": [
          "Images"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImagesResponse"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              },
              "x-ultragpt-generation-id": {
                "$ref": "#/components/headers/GenerationId"
              },
              "x-ultragpt-ignored-params": {
                "$ref": "#/components/headers/IgnoredParams"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "prompt"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "n": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4
                  },
                  "size": {
                    "type": "string",
                    "description": "WIDTHxHEIGHT, or a resolution tier (\"2K\"). Models without custom sizes take a preset from images.sizes, applied as its aspect ratio."
                  },
                  "aspect_ratio": {
                    "type": "string",
                    "description": "e.g. 16:9 - one of the model's images.aspect_ratios."
                  },
                  "quality": {
                    "type": "string",
                    "description": "One of the model's images.qualities (e.g. auto, low, medium, high)."
                  },
                  "background": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "transparent",
                      "opaque"
                    ],
                    "description": "One of the model's images.backgrounds. transparent needs output_format png or webp."
                  },
                  "response_format": {
                    "enum": [
                      "b64_json",
                      "url"
                    ]
                  },
                  "image": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "resolution": {
                    "type": "string",
                    "description": "Resolution tier, e.g. 1K, 2K, 4K - one of the model's images.resolutions."
                  },
                  "output_format": {
                    "type": "string",
                    "enum": [
                      "png",
                      "jpeg",
                      "webp",
                      "svg"
                    ],
                    "description": "One of the model's images.output_formats."
                  },
                  "output_compression": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100,
                    "description": "jpeg/webp compression, where images.output_compression is set."
                  },
                  "moderation": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "low"
                    ],
                    "description": "Content moderation strictness, where images.moderation lists it."
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Where images.seed is true. With n > 1 image i uses seed + i."
                  }
                }
              }
            }
          }
        },
        "operationId": "createImage",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/XTitle"
          },
          {
            "$ref": "#/components/parameters/HttpReferer"
          }
        ],
        "description": "Every option is checked against the model's `images` block (GET /v1/models/{model}); an option the model can't honour is a 400 with `param` set, never silently dropped."
      }
    },
    "/images/edits": {
      "post": {
        "summary": "Edit images",
        "tags": [
          "Images"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImagesResponse"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              },
              "x-ultragpt-generation-id": {
                "$ref": "#/components/headers/GenerationId"
              },
              "x-ultragpt-ignored-params": {
                "$ref": "#/components/headers/IgnoredParams"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "prompt",
                  "image"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "image": {
                    "oneOf": [
                      {
                        "type": "string",
                        "format": "binary"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "binary"
                        }
                      }
                    ],
                    "description": "The image(s) to edit (field `image` or `image[]`)."
                  },
                  "n": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4
                  },
                  "size": {
                    "type": "string",
                    "description": "WIDTHxHEIGHT, or a resolution tier (\"2K\"). Models without custom sizes take a preset from images.sizes, applied as its aspect ratio."
                  },
                  "aspect_ratio": {
                    "type": "string",
                    "description": "e.g. 16:9 - one of the model's images.aspect_ratios."
                  },
                  "quality": {
                    "type": "string",
                    "description": "One of the model's images.qualities (e.g. auto, low, medium, high)."
                  },
                  "background": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "transparent",
                      "opaque"
                    ],
                    "description": "One of the model's images.backgrounds. transparent needs output_format png or webp."
                  },
                  "response_format": {
                    "enum": [
                      "b64_json",
                      "url"
                    ]
                  },
                  "resolution": {
                    "type": "string",
                    "description": "Resolution tier, e.g. 1K, 2K, 4K - one of the model's images.resolutions."
                  },
                  "output_format": {
                    "type": "string",
                    "enum": [
                      "png",
                      "jpeg",
                      "webp",
                      "svg"
                    ],
                    "description": "One of the model's images.output_formats."
                  },
                  "output_compression": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100,
                    "description": "jpeg/webp compression, where images.output_compression is set."
                  },
                  "moderation": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "low"
                    ],
                    "description": "Content moderation strictness, where images.moderation lists it."
                  },
                  "seed": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Where images.seed is true. With n > 1 image i uses seed + i."
                  }
                }
              }
            }
          }
        },
        "operationId": "createImageEdit",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/XTitle"
          },
          {
            "$ref": "#/components/parameters/HttpReferer"
          }
        ],
        "description": "OpenAI SDK `images.edit()`. Upload one or more images as multipart `image` (or `image[]`) and describe the edit in `prompt`. Billed like an image generation. `mask` (inpainting) is not supported. Every option is checked against the model's `images` block (GET /v1/models/{model}); an option the model can't honour is a 400 with `param` set, never silently dropped."
      }
    },
    "/audio/speech": {
      "post": {
        "summary": "Text to speech",
        "tags": [
          "Audio"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/opus": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/flac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/aac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/pcm": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              },
              "x-ultragpt-generation-id": {
                "$ref": "#/components/headers/GenerationId"
              },
              "x-ultragpt-ignored-params": {
                "$ref": "#/components/headers/IgnoredParams"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {
                    "type": "string"
                  },
                  "voice": {
                    "type": "string"
                  },
                  "response_format": {
                    "enum": [
                      "mp3",
                      "opus",
                      "aac",
                      "flac",
                      "wav",
                      "pcm"
                    ]
                  },
                  "speed": {
                    "type": "number"
                  },
                  "instructions": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "operationId": "createSpeech",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/XTitle"
          },
          {
            "$ref": "#/components/parameters/HttpReferer"
          }
        ]
      }
    },
    "/audio/transcriptions": {
      "post": {
        "summary": "Speech to text",
        "tags": [
          "Audio"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transcription"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              },
              "x-ultragpt-generation-id": {
                "$ref": "#/components/headers/GenerationId"
              },
              "x-ultragpt-ignored-params": {
                "$ref": "#/components/headers/IgnoredParams"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "model"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "model": {
                    "type": "string"
                  },
                  "language": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "response_format": {
                    "type": "string"
                  },
                  "temperature": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "operationId": "createTranscription",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/XTitle"
          },
          {
            "$ref": "#/components/parameters/HttpReferer"
          }
        ]
      }
    },
    "/audio/translations": {
      "post": {
        "summary": "Translate speech to English text",
        "tags": [
          "Audio"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transcription"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              },
              "x-ultragpt-generation-id": {
                "$ref": "#/components/headers/GenerationId"
              },
              "x-ultragpt-ignored-params": {
                "$ref": "#/components/headers/IgnoredParams"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "model"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "model": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "operationId": "createTranslation",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/XTitle"
          },
          {
            "$ref": "#/components/parameters/HttpReferer"
          }
        ]
      }
    },
    "/files": {
      "post": {
        "summary": "Upload a batch input file",
        "tags": [
          "Batch"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileObject"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "purpose"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "purpose": {
                    "enum": [
                      "batch"
                    ]
                  }
                }
              }
            }
          }
        },
        "operationId": "uploadFile"
      },
      "get": {
        "summary": "List files",
        "tags": [
          "Batch"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileList"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "listFiles",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1000
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Cursor: the last id of the previous page."
          }
        ]
      }
    },
    "/files/{id}": {
      "get": {
        "summary": "Retrieve a file",
        "tags": [
          "Batch"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileObject"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "retrieveFile"
      },
      "delete": {
        "summary": "Delete a file",
        "tags": [
          "Batch"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedObject"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "deleteFile"
      }
    },
    "/files/{id}/content": {
      "get": {
        "summary": "Download a file's content",
        "tags": [
          "Batch"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/jsonl": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "downloadFile"
      }
    },
    "/batches": {
      "post": {
        "summary": "Create a batch",
        "tags": [
          "Batch"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "input_file_id",
                  "endpoint"
                ],
                "properties": {
                  "input_file_id": {
                    "type": "string"
                  },
                  "endpoint": {
                    "enum": [
                      "/v1/chat/completions",
                      "/v1/embeddings"
                    ]
                  },
                  "completion_window": {
                    "enum": [
                      "24h"
                    ]
                  },
                  "metadata": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "operationId": "createBatch",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "get": {
        "summary": "List batches",
        "tags": [
          "Batch"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchList"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Cursor: the last id of the previous page."
          }
        ],
        "operationId": "listBatches"
      }
    },
    "/batches/{id}": {
      "get": {
        "summary": "Retrieve a batch",
        "tags": [
          "Batch"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "retrieveBatch"
      }
    },
    "/batches/{id}/cancel": {
      "post": {
        "summary": "Cancel a batch",
        "tags": [
          "Batch"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "cancelBatch"
      }
    },
    "/models": {
      "get": {
        "summary": "List models",
        "tags": [
          "Models"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelList"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "supported_parameters",
            "in": "query",
            "required": false,
            "description": "Comma-separated, all must match (e.g. tools,reasoning)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "input_modalities",
            "in": "query",
            "required": false,
            "description": "Comma-separated",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "output_modalities",
            "in": "query",
            "required": false,
            "description": "Comma-separated",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "listModels"
      }
    },
    "/key": {
      "get": {
        "summary": "The calling key",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CurrentKey"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "Limits (requests and tokens per minute, spend limit) and spend per period of the calling key.",
        "operationId": "getCurrentKey"
      }
    },
    "/credits": {
      "get": {
        "summary": "Credit balance",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credits"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "getCredits"
      }
    },
    "/generation": {
      "get": {
        "summary": "Stats and cost of one request",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationResponse"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getGeneration"
      }
    },
    "/rerank": {
      "post": {
        "summary": "Rerank documents",
        "description": "Order documents by relevance to a query (Cohere-compatible). Billed per search unit.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rerank"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "query": {
                    "type": "string"
                  },
                  "documents": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "text": {
                              "type": "string"
                            }
                          },
                          "required": []
                        }
                      ]
                    }
                  },
                  "top_n": {
                    "type": "integer"
                  },
                  "return_documents": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "model",
                  "query",
                  "documents"
                ]
              }
            }
          }
        },
        "operationId": "createRerank",
        "tags": [
          "Utilities"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/moderations": {
      "post": {
        "summary": "Create moderation",
        "description": "Classify text / image input for harmful content (OpenAI shape). Free.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Moderation"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    ]
                  }
                },
                "required": [
                  "input"
                ]
              }
            }
          }
        },
        "operationId": "createModeration",
        "tags": [
          "Utilities"
        ]
      }
    },
    "/search": {
      "post": {
        "summary": "Web search",
        "description": "Standalone web search; pass the engine in search_tool_name. Billed per query.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResults"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "search_tool_name": {
                    "type": "string"
                  },
                  "max_results": {
                    "type": "integer"
                  },
                  "search_domain_filter": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "country": {
                    "type": "string"
                  },
                  "max_tokens_per_page": {
                    "type": "integer"
                  }
                },
                "required": [
                  "query"
                ]
              }
            }
          }
        },
        "operationId": "search",
        "tags": [
          "Utilities"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/search/{engine}": {
      "post": {
        "summary": "Web search with an engine",
        "description": "Standalone web search on one engine (GET /models?type=search lists them).",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResults"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "search_tool_name": {
                    "type": "string"
                  },
                  "max_results": {
                    "type": "integer"
                  },
                  "search_domain_filter": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "country": {
                    "type": "string"
                  },
                  "max_tokens_per_page": {
                    "type": "integer"
                  }
                },
                "required": [
                  "query"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "engine",
            "in": "path",
            "required": true,
            "description": "Search engine model id, e.g. tavily-search",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "operationId": "searchWithEngine",
        "tags": [
          "Utilities"
        ]
      }
    },
    "/models/count": {
      "get": {
        "summary": "Count models",
        "description": "Number of models /models returns for the same filters.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelCount"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Model type",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "supported_parameters",
            "in": "query",
            "required": false,
            "description": "Comma-separated",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "input_modalities",
            "in": "query",
            "required": false,
            "description": "Comma-separated",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "output_modalities",
            "in": "query",
            "required": false,
            "description": "Comma-separated",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "countModels",
        "tags": [
          "Models"
        ]
      }
    },
    "/presets": {
      "get": {
        "summary": "List presets",
        "description": "Presets of the key's workspace. Use as model \"@preset/{slug}\".",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresetList"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "listPresets",
        "tags": [
          "Presets"
        ]
      },
      "post": {
        "summary": "Create preset",
        "description": "Management keys only.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Preset"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "config": {
                    "type": "object",
                    "properties": {
                      "model": {
                        "type": "string"
                      },
                      "models": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "system_prompt": {
                        "type": "string"
                      },
                      "params": {
                        "type": "object"
                      },
                      "provider": {
                        "type": "object"
                      },
                      "reasoning": {
                        "type": "object"
                      },
                      "plugins": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "tools": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "cache": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "type": "boolean"
                          },
                          "ttl_seconds": {
                            "type": "integer"
                          }
                        },
                        "required": []
                      }
                    },
                    "required": []
                  }
                },
                "required": [
                  "slug"
                ]
              }
            }
          }
        },
        "operationId": "createPreset",
        "tags": [
          "Presets"
        ]
      }
    },
    "/presets/{slug}": {
      "get": {
        "summary": "Get preset",
        "description": "With version history.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Preset"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Preset slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getPreset",
        "tags": [
          "Presets"
        ]
      },
      "patch": {
        "summary": "Update preset",
        "description": "Management keys only; a config change creates a new version.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Preset"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "config": {
                    "type": "object",
                    "properties": {
                      "model": {
                        "type": "string"
                      },
                      "models": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "system_prompt": {
                        "type": "string"
                      },
                      "params": {
                        "type": "object"
                      },
                      "provider": {
                        "type": "object"
                      },
                      "reasoning": {
                        "type": "object"
                      },
                      "plugins": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "tools": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      "cache": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "type": "boolean"
                          },
                          "ttl_seconds": {
                            "type": "integer"
                          }
                        },
                        "required": []
                      }
                    },
                    "required": []
                  }
                },
                "required": [
                  "slug"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Preset slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "updatePreset",
        "tags": [
          "Presets"
        ]
      },
      "delete": {
        "summary": "Delete preset",
        "description": "Management keys only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedObject"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Preset slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "deletePreset",
        "tags": [
          "Presets"
        ]
      }
    },
    "/keys": {
      "get": {
        "summary": "List keys",
        "description": "Management keys only: keys of the workspace with monthly usage and remaining limit.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedKeyList"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "listKeys",
        "tags": [
          "Keys"
        ]
      },
      "post": {
        "summary": "Create key",
        "description": "Management keys only. `limit` + `limit_reset` set a spend limit per day, ISO week, month or lifetime. The key string is returned once.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedKey"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "project": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "live",
                      "test"
                    ]
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "full",
                      "read_only"
                    ]
                  },
                  "limit": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Spend limit in USD per limit_reset period."
                  },
                  "allowed_models": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "allowed_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "allowed_referrers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "rpm_limit": {
                    "type": "integer"
                  },
                  "expires_in_days": {
                    "type": "integer"
                  },
                  "limit_reset": {
                    "type": "string",
                    "enum": [
                      "daily",
                      "weekly",
                      "monthly",
                      "never"
                    ],
                    "description": "When the spend limit starts over (default monthly). never = a lifetime budget."
                  },
                  "tpm_limit": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Tokens per minute; can only lower the default."
                  }
                },
                "required": []
              }
            }
          }
        },
        "operationId": "createKey",
        "tags": [
          "Keys"
        ]
      }
    },
    "/keys/{id}": {
      "get": {
        "summary": "Get key",
        "description": "Management keys only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedKeyResponse"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Key id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "getKey",
        "tags": [
          "Keys"
        ]
      },
      "patch": {
        "summary": "Update key",
        "description": "Management keys only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedKeyResponse"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "project": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "live",
                      "test"
                    ]
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "full",
                      "read_only"
                    ]
                  },
                  "limit": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Spend limit in USD per limit_reset period."
                  },
                  "allowed_models": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "allowed_ips": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "allowed_referrers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "rpm_limit": {
                    "type": "integer"
                  },
                  "expires_in_days": {
                    "type": "integer"
                  },
                  "limit_reset": {
                    "type": "string",
                    "enum": [
                      "daily",
                      "weekly",
                      "monthly",
                      "never"
                    ],
                    "description": "When the spend limit starts over (default monthly). never = a lifetime budget."
                  },
                  "tpm_limit": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Tokens per minute; can only lower the default."
                  }
                },
                "required": []
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Key id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "updateKey",
        "tags": [
          "Keys"
        ]
      },
      "delete": {
        "summary": "Revoke key",
        "description": "Management keys only.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedKey"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Key id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "deleteKey",
        "tags": [
          "Keys"
        ]
      }
    },
    "/activity": {
      "get": {
        "summary": "Activity",
        "description": "Daily usage per model and endpoint over the last 30 days.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Activity"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key_id",
            "in": "query",
            "required": false,
            "description": "Management keys: one key",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": false,
            "description": "End user (user / safety_identifier)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "listActivity",
        "tags": [
          "Account"
        ]
      }
    },
    "/generations/lookup": {
      "post": {
        "summary": "Look up generations",
        "description": "Stats and billed cost of up to 1000 requests by id. Read-only keys allowed.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationLookup"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "ids"
                ]
              }
            }
          }
        },
        "operationId": "lookupGenerations",
        "tags": [
          "Account"
        ]
      }
    },
    "/videos": {
      "post": {
        "summary": "Create a video",
        "tags": [
          "Videos"
        ],
        "description": "Starts an asynchronous text- or image-to-video job. Billed the provider cost when it completes; failed clips are free.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "prompt"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string",
                    "maxLength": 4000
                  },
                  "seconds": {
                    "oneOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "Clip length; see the model's video.durations"
                  },
                  "aspect_ratio": {
                    "type": "string",
                    "example": "16:9"
                  },
                  "size": {
                    "type": "string",
                    "example": "1280x720",
                    "description": "Alternative to aspect_ratio"
                  },
                  "resolution": {
                    "type": "string"
                  },
                  "image_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public https first frame (models with image input)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Video"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "createVideo"
      },
      "get": {
        "summary": "List videos",
        "tags": [
          "Videos"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Cursor: the last id of the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoList"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "listVideos"
      }
    },
    "/videos/{id}": {
      "get": {
        "summary": "Retrieve a video",
        "tags": [
          "Videos"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Video"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "retrieveVideo"
      },
      "delete": {
        "summary": "Delete a video",
        "tags": [
          "Videos"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedObject"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "deleteVideo"
      }
    },
    "/videos/{id}/content": {
      "get": {
        "summary": "Download a video",
        "tags": [
          "Videos"
        ],
        "description": "302 redirect to the MP4 (or the poster with ?variant=thumbnail). 409 video_not_ready until completed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "variant",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "thumbnail"
              ]
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the file",
            "headers": {
              "location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                },
                "description": "Short-lived download URL"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "downloadVideoContent"
      }
    },
    "/realtime": {
      "get": {
        "summary": "Realtime session (WebSocket)",
        "tags": [
          "Realtime"
        ],
        "description": "Upgrade to a WebSocket (wss://api.ultragpt.pro/v1/realtime?model=<id>) and speak the OpenAI Realtime protocol. Auth: Authorization header, or the subprotocol `openai-insecure-api-key.<key>` from browsers. Each response.done is billed from upstream usage. Sessions end after 60 minutes, 10 idle minutes or when funds run out (close code 1008).",
        "parameters": [
          {
            "name": "model",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "101": {
            "description": "Switching protocols"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "operationId": "connectRealtime"
      }
    },
    "/models/{model}": {
      "get": {
        "summary": "Retrieve a model",
        "tags": [
          "Models"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Model"
                }
              }
            },
            "headers": {
              "x-ratelimit-limit-requests": {
                "$ref": "#/components/headers/RateLimitLimitRequests"
              },
              "x-ratelimit-remaining-requests": {
                "$ref": "#/components/headers/RateLimitRemainingRequests"
              },
              "x-ratelimit-reset-requests": {
                "$ref": "#/components/headers/RateLimitResetRequests"
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "operationId": "retrieveModel"
      }
    }
  },
  "tags": [
    {
      "name": "Chat",
      "description": "OpenAI chat completions, Anthropic messages, the Responses API and legacy completions."
    },
    {
      "name": "Embeddings",
      "description": "Text embeddings (OpenAI shape)."
    },
    {
      "name": "Images",
      "description": "Image generation and editing."
    },
    {
      "name": "Audio",
      "description": "Speech synthesis, transcription and translation."
    },
    {
      "name": "Utilities",
      "description": "Rerank, moderation and web search."
    },
    {
      "name": "Batch",
      "description": "Files and batches at the discounted batch price."
    },
    {
      "name": "Videos",
      "description": "Asynchronous video generation: create, poll, download."
    },
    {
      "name": "Realtime",
      "description": "Low-latency speech-to-speech over WebSocket (OpenAI Realtime protocol)."
    },
    {
      "name": "Models",
      "description": "The model catalog with prices, modalities and supported parameters."
    },
    {
      "name": "Account",
      "description": "The calling key, credits, generations and activity."
    },
    {
      "name": "Presets",
      "description": "Reusable request configs (`@preset/<slug>`). Writes need a management key."
    },
    {
      "name": "Keys",
      "description": "Provision keys programmatically. Management keys only."
    }
  ]
}
