@reverbia/portal 1.0.0-next.20251219195611 → 1.0.0-next.20251222163902

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/swagger.json +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reverbia/portal",
3
- "version": "1.0.0-next.20251219195611",
3
+ "version": "1.0.0-next.20251222163902",
4
4
  "description": "AI Portal is a prepaid escrow-based API gateway for wallet-authenticated LLM usage. It provides an OpenAI-compatible API with on-chain settlement for AI inference costs.",
5
5
  "main": "index.js",
6
6
  "directories": {
package/swagger.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
- "components": {"schemas":{"handlers.ExchangeRequest":{"properties":{"code":{"type":"string"},"redirect_uri":{"description":"Optional - uses config default if not provided","type":"string"}},"required":["code"],"type":"object"},"handlers.HealthResponse":{"properties":{"status":{"description":"Status indicates the service health status","type":"string"},"timestamp":{"description":"Timestamp is the Unix timestamp of the response","type":"integer"},"version":{"description":"Version is the current API version","type":"string"}},"type":"object"},"handlers.RefreshRequest":{"properties":{"refresh_token":{"type":"string"}},"required":["refresh_token"],"type":"object"},"handlers.RevokeRequest":{"properties":{"token":{"type":"string"}},"required":["token"],"type":"object"},"handlers.TokenResponse":{"properties":{"access_token":{"type":"string"},"expires_in":{"description":"Seconds until expiration","type":"integer"},"refresh_token":{"description":"May not be present on refresh","type":"string"},"scope":{"description":"Granted scopes","type":"string"},"token_type":{"description":"Usually \"Bearer\"","type":"string"}},"type":"object"},"llmapi.ChatCompletionExtraFields":{"description":"ExtraFields contains additional metadata","properties":{"latency":{"description":"Latency is the request latency in milliseconds","type":"integer"},"model_requested":{"description":"ModelRequested is the model that was requested","type":"string"},"provider":{"description":"Provider is the LLM provider used (e.g., \"openai\", \"anthropic\")","type":"string"},"request_type":{"description":"RequestType is always \"chat_completion\"","type":"string"}},"type":"object"},"llmapi.ChatCompletionRequest":{"properties":{"messages":{"description":"Messages is the conversation history","items":{"$ref":"#/components/schemas/llmapi.Message"},"type":"array","uniqueItems":false},"model":{"description":"Model is the model identifier","type":"string"},"stream":{"description":"Stream indicates if response should be streamed","type":"boolean"}},"required":["messages","model"],"type":"object"},"llmapi.ChatCompletionResponse":{"properties":{"choices":{"description":"Choices contains the completion choices","items":{"$ref":"#/components/schemas/llmapi.Choice"},"type":"array","uniqueItems":false},"extra_fields":{"$ref":"#/components/schemas/llmapi.ChatCompletionExtraFields"},"id":{"description":"ID is the completion ID","type":"string"},"model":{"description":"Model is the model used","type":"string"},"usage":{"$ref":"#/components/schemas/llmapi.ChatCompletionUsage"}},"type":"object"},"llmapi.ChatCompletionUsage":{"description":"Usage contains token usage information","properties":{"completion_tokens":{"description":"CompletionTokens is the number of tokens in the completion","type":"integer"},"cost_micro_usd":{"description":"CostMicroUSD is the cost of this completion in micro-dollars (USD × 1,000,000)","type":"integer"},"prompt_tokens":{"description":"PromptTokens is the number of tokens in the prompt","type":"integer"},"total_tokens":{"description":"TotalTokens is the total number of tokens used","type":"integer"}},"type":"object"},"llmapi.Choice":{"properties":{"finish_reason":{"description":"FinishReason indicates why the completion stopped","type":"string"},"index":{"description":"Index is the choice index","type":"integer"},"message":{"$ref":"#/components/schemas/llmapi.Message"}},"type":"object"},"llmapi.EmbeddingData":{"properties":{"embedding":{"description":"Embedding vector","items":{"type":"number"},"type":"array","uniqueItems":false},"index":{"description":"Index of the embedding","type":"integer"},"object":{"description":"Object type identifier","type":"string"}},"type":"object"},"llmapi.EmbeddingExtraFields":{"description":"ExtraFields contains additional metadata","properties":{"chunk_index":{"description":"ChunkIndex is the chunk index (0 for single requests)","type":"integer"},"latency":{"description":"Latency is the request latency in milliseconds","type":"integer"},"model_requested":{"description":"ModelRequested is the model that was requested","type":"string"},"provider":{"description":"Provider is the LLM provider used (e.g., \"openai\", \"anthropic\")","type":"string"},"request_type":{"description":"RequestType is always \"embedding\"","type":"string"}},"type":"object"},"llmapi.EmbeddingRequest":{"properties":{"dimensions":{"description":"Dimensions is the number of dimensions the resulting output embeddings should have (optional)","type":"integer"},"encoding_format":{"description":"EncodingFormat is the format to return the embeddings in (optional: \"float\" or \"base64\")","type":"string"},"input":{"description":"Input text or tokens to embed (can be string, []string, []int, or [][]int)"},"model":{"description":"Model identifier in 'provider/model' format","type":"string"}},"required":["input","model"],"type":"object"},"llmapi.EmbeddingResponse":{"properties":{"data":{"description":"Data contains the embeddings","items":{"$ref":"#/components/schemas/llmapi.EmbeddingData"},"type":"array","uniqueItems":false},"extra_fields":{"$ref":"#/components/schemas/llmapi.EmbeddingExtraFields"},"model":{"description":"Model is the model used","type":"string"},"object":{"description":"Object is always \"list\"","type":"string"},"usage":{"$ref":"#/components/schemas/llmapi.EmbeddingUsage"}},"type":"object"},"llmapi.EmbeddingUsage":{"description":"Usage contains token usage information","properties":{"cost_micro_usd":{"description":"CostMicroUSD is the inference cost for this embedding request","type":"integer"},"prompt_tokens":{"description":"PromptTokens is the number of tokens in the prompt","type":"integer"},"total_tokens":{"description":"TotalTokens is the total number of tokens used","type":"integer"}},"type":"object"},"llmapi.ImageGenerationExtraFields":{"description":"ExtraFields contains additional metadata such as provider/model information.","properties":{"model_requested":{"description":"ModelRequested is the model identifier that the client asked for.","type":"string"},"provider":{"description":"Provider is the gateway that serviced this request.","type":"string"},"request_type":{"description":"RequestType is always \"image_generation\".","type":"string"}},"type":"object"},"llmapi.ImageGenerationImage":{"properties":{"b64_json":{"description":"B64JSON is the base64 payload for models that can only return binary.","type":"string"},"url":{"description":"URL is the signed URL to download the image.","type":"string"}},"type":"object"},"llmapi.ImageGenerationRequest":{"properties":{"model":{"description":"Model is the model identifier to use for generation (e.g., \"gpt-image-1\").","type":"string"},"prompt":{"description":"Prompt is the text description of the desired image.","type":"string"},"quality":{"description":"Quality targets a quality preset (e.g., \"auto\", \"high\").","type":"string"},"response_format":{"description":"ResponseFormat controls how the generated image is returned (e.g., \"url\" or \"b64_json\").","type":"string"},"size":{"description":"Size controls the dimensions of the generated image (e.g., \"1024x1024\").","type":"string"}},"required":["model","prompt"],"type":"object"},"llmapi.ImageGenerationResponse":{"properties":{"created":{"description":"Created is the Unix timestamp when the image was generated.","type":"integer"},"extra_fields":{"$ref":"#/components/schemas/llmapi.ImageGenerationExtraFields"},"images":{"description":"Images contains the generated images.","items":{"$ref":"#/components/schemas/llmapi.ImageGenerationImage"},"type":"array","uniqueItems":false},"model":{"description":"Model is the model identifier that generated the image.","type":"string"},"provider":{"description":"Provider is the gateway that produced the image.","type":"string"},"usage":{"$ref":"#/components/schemas/llmapi.ImageGenerationUsage"}},"type":"object"},"llmapi.ImageGenerationUsage":{"description":"Usage documents token usage (when available).","properties":{"cost_micro_usd":{"description":"CostMicroUSD is the inference cost for this image generation request","type":"integer"},"input_tokens":{"description":"InputTokens is the number of tokens sent in the prompt.","type":"integer"},"output_tokens":{"description":"OutputTokens is the number of tokens returned by the model.","type":"integer"},"total_tokens":{"description":"TotalTokens is the total number of tokens consumed.","type":"integer"}},"type":"object"},"llmapi.Message":{"description":"Message is the generated message","properties":{"content":{"description":"Content is the message content","items":{"$ref":"#/components/schemas/llmapi.MessageContentPart"},"type":"array","uniqueItems":false},"role":{"$ref":"#/components/schemas/llmapi.Role"},"tool_calls":{"description":"ToolCalls contains tool/function calls made by the assistant (only for assistant role)","items":{"$ref":"#/components/schemas/llmapi.ToolCall"},"type":"array","uniqueItems":false}},"type":"object"},"llmapi.MessageContentImage":{"description":"ImageURL is used when Type=image_url","properties":{"detail":{"description":"Detail is the OpenAI detail hint (auto|low|high)","type":"string"},"url":{"description":"URL is the image URL or data URI","type":"string"}},"type":"object"},"llmapi.MessageContentPart":{"properties":{"image_url":{"$ref":"#/components/schemas/llmapi.MessageContentImage"},"text":{"description":"Text holds the text content when Type=text","type":"string"},"type":{"description":"Type is the block type (`text` or `image_url`)","type":"string"}},"type":"object"},"llmapi.Model":{"properties":{"architecture":{"$ref":"#/components/schemas/llmapi.ModelArchitecture"},"canonical_slug":{"description":"CanonicalSlug is the canonical slug for the model","type":"string"},"context_length":{"description":"ContextLength is the maximum context length in tokens","type":"integer"},"created":{"description":"Created is the Unix timestamp of when the model was created","type":"integer"},"default_parameters":{"additionalProperties":{},"description":"DefaultParameters contains default parameter values","type":"object"},"description":{"description":"Description describes the model and its capabilities","type":"string"},"hugging_face_id":{"description":"HuggingFaceID is the Hugging Face model identifier","type":"string"},"id":{"description":"ID is the model identifier (e.g., \"openai/gpt-4\")","type":"string"},"max_input_tokens":{"description":"MaxInputTokens is the maximum input tokens","type":"integer"},"max_output_tokens":{"description":"MaxOutputTokens is the maximum output tokens","type":"integer"},"modalities":{"description":"Modalities is a list of supported modalities (e.g., [\"llm\", \"vision\"])","items":{"type":"string"},"type":"array","uniqueItems":false},"name":{"description":"Name is the human-readable model name (optional)","type":"string"},"owned_by":{"description":"OwnedBy is the organization that owns the model","type":"string"},"per_request_limits":{"$ref":"#/components/schemas/llmapi.ModelPerRequestLimits"},"pricing":{"$ref":"#/components/schemas/llmapi.ModelPricing"},"supported_methods":{"description":"SupportedMethods is a list of supported API methods","items":{"type":"string"},"type":"array","uniqueItems":false},"supported_parameters":{"description":"SupportedParameters is a list of supported parameter names","items":{"type":"string"},"type":"array","uniqueItems":false},"top_provider":{"$ref":"#/components/schemas/llmapi.ModelTopProvider"}},"type":"object"},"llmapi.ModelArchitecture":{"description":"Architecture describes the model's technical capabilities","properties":{"instruct_type":{"type":"string"},"modality":{"type":"string"},"prompt_formatting":{"type":"string"},"tokenizer":{"type":"string"}},"type":"object"},"llmapi.ModelPerRequestLimits":{"description":"PerRequestLimits contains rate limiting information","properties":{"completion_tokens":{"type":"integer"},"prompt_tokens":{"type":"integer"}},"type":"object"},"llmapi.ModelPricing":{"description":"Pricing contains the pricing structure for using this model","properties":{"completion":{"type":"string"},"image":{"type":"string"},"prompt":{"type":"string"},"request":{"type":"string"}},"type":"object"},"llmapi.ModelTopProvider":{"description":"TopProvider contains configuration details for the primary provider","properties":{"context_length":{"type":"integer"},"is_moderated":{"type":"boolean"},"max_completion_tokens":{"type":"integer"}},"type":"object"},"llmapi.ModelsListExtraFields":{"description":"ExtraFields contains additional metadata","properties":{"chunk_index":{"description":"ChunkIndex is the chunk index (0 for single requests)","type":"integer"},"latency":{"description":"Latency is the request latency in milliseconds","type":"integer"},"request_type":{"description":"RequestType is always \"list_models\"","type":"string"}},"type":"object"},"llmapi.ModelsListResponse":{"properties":{"data":{"description":"Data contains the list of available models","items":{"$ref":"#/components/schemas/llmapi.Model"},"type":"array","uniqueItems":false},"extra_fields":{"$ref":"#/components/schemas/llmapi.ModelsListExtraFields"},"next_page_token":{"description":"NextPageToken is the token to retrieve the next page of results (omitted if no more pages)","type":"string"}},"type":"object"},"llmapi.ResponseExtraFields":{"description":"ExtraFields contains additional metadata","properties":{"latency":{"description":"Latency is the request latency in milliseconds","type":"integer"},"model_requested":{"description":"ModelRequested is the model that was requested","type":"string"},"provider":{"description":"Provider is the LLM provider used (e.g., \"openai\", \"anthropic\")","type":"string"},"request_type":{"description":"RequestType is always \"responses\"","type":"string"}},"type":"object"},"llmapi.ResponseOutputContent":{"properties":{"text":{"description":"Text is the text content","type":"string"},"type":{"description":"Type is the content type (e.g., \"output_text\")","type":"string"}},"type":"object"},"llmapi.ResponseOutputItem":{"properties":{"arguments":{"description":"Arguments is the function arguments for function_call types","type":"string"},"call_id":{"description":"CallID is the call ID for function_call types","type":"string"},"content":{"description":"Content is the content array for message types","items":{"$ref":"#/components/schemas/llmapi.ResponseOutputContent"},"type":"array","uniqueItems":false},"id":{"description":"ID is the unique identifier for this output item","type":"string"},"name":{"description":"Name is the function name for function_call types","type":"string"},"role":{"description":"Role is the role for message types (e.g., \"assistant\")","type":"string"},"status":{"description":"Status is the status of this output item (e.g., \"completed\")","type":"string"},"type":{"description":"Type is the output item type (e.g., \"message\", \"function_call\")","type":"string"}},"type":"object"},"llmapi.ResponseRequest":{"properties":{"background":{"description":"Background indicates if request should be processed in background","type":"boolean"},"conversation":{"description":"Conversation is the conversation ID (optional)","type":"string"},"input":{"description":"Input is the simple text input for the response","type":"string"},"max_output_tokens":{"description":"MaxOutputTokens is the maximum number of tokens to generate","type":"integer"},"model":{"description":"Model is the model identifier in 'provider/model' format","type":"string"},"previous_response_id":{"description":"PreviousResponseID is the ID of a previous response to continue from","type":"string"},"store":{"description":"Store indicates if the response should be stored","type":"boolean"},"stream":{"description":"Stream indicates if response should be streamed","type":"boolean"},"temperature":{"description":"Temperature controls randomness (0.0 to 2.0)","type":"number"},"tool_choice":{"description":"ToolChoice controls which tool to use (auto, any, none, required, or tool name)","type":"string"},"tools":{"description":"Tools is an array of tool definitions (passed through, no MCP loop)","items":{"$ref":"#/components/schemas/llmapi.Tool"},"type":"array","uniqueItems":false}},"required":["input","model"],"type":"object"},"llmapi.ResponseResponse":{"properties":{"created_at":{"description":"Created is the Unix timestamp of creation (created_at in OpenAI format)","type":"integer"},"extra_fields":{"$ref":"#/components/schemas/llmapi.ResponseExtraFields"},"id":{"description":"ID is the unique response identifier","type":"string"},"model":{"description":"Model is the model used for generation","type":"string"},"object":{"description":"Object is the response type (e.g., \"response\")","type":"string"},"output":{"description":"Output is the array of output items (OpenAI Responses API format)","items":{"$ref":"#/components/schemas/llmapi.ResponseOutputItem"},"type":"array","uniqueItems":false},"usage":{"$ref":"#/components/schemas/llmapi.ResponseUsage"}},"type":"object"},"llmapi.ResponseUsage":{"description":"Usage contains token usage information","properties":{"completion_tokens":{"description":"CompletionTokens is the number of tokens in the completion","type":"integer"},"cost_micro_usd":{"description":"CostMicroUSD is the cost of this response in micro-dollars (USD × 1,000,000)","type":"integer"},"prompt_tokens":{"description":"PromptTokens is the number of tokens in the prompt","type":"integer"},"total_tokens":{"description":"TotalTokens is the total number of tokens used","type":"integer"}},"type":"object"},"llmapi.Role":{"description":"Role is the message role (system, user, assistant)","type":"string","x-enum-varnames":["RoleAssistant","RoleUser","RoleSystem"]},"llmapi.SearchExtraFields":{"description":"ExtraFields contains additional metadata.","properties":{"request_type":{"description":"RequestType is always \"search\".","type":"string"},"search_provider":{"description":"SearchProvider is the search provider used (e.g., \"perplexity\", \"google-pse\").","type":"string"}},"type":"object"},"llmapi.SearchRequest":{"properties":{"country":{"description":"Country code filter (e.g., \"US\", \"GB\", \"DE\").","type":"string"},"max_results":{"description":"Maximum number of results to return (1-20). Default: 10.","type":"integer"},"max_tokens_per_page":{"description":"Maximum tokens per page to process. Default: 1024.","type":"integer"},"query":{"description":"Search query. Can be a single string or array of strings.","items":{"type":"string"},"type":"array","uniqueItems":false},"search_domain_filter":{"description":"List of domains to filter results (max 20 domains).","items":{"type":"string"},"type":"array","uniqueItems":false},"search_tool_name":{"description":"The search provider to use.","type":"string"}},"required":["query","search_tool_name"],"type":"object"},"llmapi.SearchResponse":{"properties":{"extra_fields":{"$ref":"#/components/schemas/llmapi.SearchExtraFields"},"results":{"description":"List of search results.","items":{"$ref":"#/components/schemas/llmapi.SearchResult"},"type":"array","uniqueItems":false},"usage":{"$ref":"#/components/schemas/llmapi.SearchUsage"}},"type":"object"},"llmapi.SearchResult":{"properties":{"date":{"description":"Optional publication or last updated date.","type":"string"},"snippet":{"description":"Text snippet from the result.","type":"string"},"title":{"description":"Title of the search result.","type":"string"},"url":{"description":"URL of the search result.","type":"string"}},"type":"object"},"llmapi.SearchUsage":{"description":"Usage contains usage information.","properties":{"cost_micro_usd":{"description":"CostMicroUSD is the cost of this search in micro-dollars (USD × 1,000,000).","type":"integer"}},"type":"object"},"llmapi.Tool":{"properties":{"function":{"$ref":"#/components/schemas/llmapi.ToolFunction"},"type":{"description":"Type is the tool type (function, code_interpreter, file_search, web_search)","type":"string"}},"type":"object"},"llmapi.ToolCall":{"properties":{"function":{"$ref":"#/components/schemas/llmapi.ToolCallFunction"},"id":{"description":"ID is the unique identifier for this tool call","type":"string"},"type":{"description":"Type is the type of tool call (always \"function\" for now)","type":"string"}},"type":"object"},"llmapi.ToolCallFunction":{"description":"Function contains the function call details","properties":{"arguments":{"description":"Arguments is the JSON string of arguments to pass to the function","type":"string"},"name":{"description":"Name is the name of the function to call","type":"string"}},"type":"object"},"llmapi.ToolFunction":{"description":"Function is the function definition (when Type is \"function\")","properties":{"arguments":{"additionalProperties":{},"description":"Arguments is the function arguments schema (JSON object)","type":"object"},"name":{"description":"Name is the function name","type":"string"}},"type":"object"},"response.ErrorResponse":{"properties":{"error":{"type":"string"}},"type":"object"}}},
2
+ "components": {"schemas":{"handlers.ConfigResponse":{"properties":{"chain_id":{"description":"ChainID is the blockchain chain ID","type":"string"},"cost_limit_escrow_address":{"description":"CostLimitEscrowAddress is the cost-limit escrow contract address (if configured)","type":"string"},"operator_address":{"description":"OperatorAddress is the operator wallet address","type":"string"},"pay_as_you_go_escrow_address":{"description":"PayAsYouGoEscrowAddress is the pay-as-you-go escrow contract address (if configured)","type":"string"},"payment_model":{"description":"PaymentModel is the payment model used (pay_as_you_go or cost_limit)","type":"string"},"settlement_recipient":{"description":"SettlementRecipient is the address that receives settlement payments","type":"string"}},"type":"object"},"handlers.ExchangeRequest":{"properties":{"code":{"type":"string"},"redirect_uri":{"description":"Optional - uses config default if not provided","type":"string"}},"required":["code"],"type":"object"},"handlers.HealthResponse":{"properties":{"status":{"description":"Status indicates the service health status","type":"string"},"timestamp":{"description":"Timestamp is the Unix timestamp of the response","type":"integer"},"version":{"description":"Version is the current API version","type":"string"}},"type":"object"},"handlers.RefreshRequest":{"properties":{"refresh_token":{"type":"string"}},"required":["refresh_token"],"type":"object"},"handlers.RevokeRequest":{"properties":{"token":{"type":"string"}},"required":["token"],"type":"object"},"handlers.TokenResponse":{"properties":{"access_token":{"type":"string"},"expires_in":{"description":"Seconds until expiration","type":"integer"},"refresh_token":{"description":"May not be present on refresh","type":"string"},"scope":{"description":"Granted scopes","type":"string"},"token_type":{"description":"Usually \"Bearer\"","type":"string"}},"type":"object"},"llmapi.ChatCompletionExtraFields":{"description":"ExtraFields contains additional metadata","properties":{"latency":{"description":"Latency is the request latency in milliseconds","type":"integer"},"model_requested":{"description":"ModelRequested is the model that was requested","type":"string"},"provider":{"description":"Provider is the LLM provider used (e.g., \"openai\", \"anthropic\")","type":"string"},"request_type":{"description":"RequestType is always \"chat_completion\"","type":"string"}},"type":"object"},"llmapi.ChatCompletionRequest":{"properties":{"messages":{"description":"Messages is the conversation history","items":{"$ref":"#/components/schemas/llmapi.Message"},"type":"array","uniqueItems":false},"model":{"description":"Model is the model identifier","type":"string"},"stream":{"description":"Stream indicates if response should be streamed","type":"boolean"}},"required":["messages","model"],"type":"object"},"llmapi.ChatCompletionResponse":{"properties":{"choices":{"description":"Choices contains the completion choices","items":{"$ref":"#/components/schemas/llmapi.Choice"},"type":"array","uniqueItems":false},"extra_fields":{"$ref":"#/components/schemas/llmapi.ChatCompletionExtraFields"},"id":{"description":"ID is the completion ID","type":"string"},"model":{"description":"Model is the model used","type":"string"},"usage":{"$ref":"#/components/schemas/llmapi.ChatCompletionUsage"}},"type":"object"},"llmapi.ChatCompletionUsage":{"description":"Usage contains token usage information","properties":{"completion_tokens":{"description":"CompletionTokens is the number of tokens in the completion","type":"integer"},"cost_micro_usd":{"description":"CostMicroUSD is the cost of this completion in micro-dollars (USD × 1,000,000)","type":"integer"},"prompt_tokens":{"description":"PromptTokens is the number of tokens in the prompt","type":"integer"},"total_tokens":{"description":"TotalTokens is the total number of tokens used","type":"integer"}},"type":"object"},"llmapi.Choice":{"properties":{"finish_reason":{"description":"FinishReason indicates why the completion stopped","type":"string"},"index":{"description":"Index is the choice index","type":"integer"},"message":{"$ref":"#/components/schemas/llmapi.Message"}},"type":"object"},"llmapi.EmbeddingData":{"properties":{"embedding":{"description":"Embedding vector","items":{"type":"number"},"type":"array","uniqueItems":false},"index":{"description":"Index of the embedding","type":"integer"},"object":{"description":"Object type identifier","type":"string"}},"type":"object"},"llmapi.EmbeddingExtraFields":{"description":"ExtraFields contains additional metadata","properties":{"chunk_index":{"description":"ChunkIndex is the chunk index (0 for single requests)","type":"integer"},"latency":{"description":"Latency is the request latency in milliseconds","type":"integer"},"model_requested":{"description":"ModelRequested is the model that was requested","type":"string"},"provider":{"description":"Provider is the LLM provider used (e.g., \"openai\", \"anthropic\")","type":"string"},"request_type":{"description":"RequestType is always \"embedding\"","type":"string"}},"type":"object"},"llmapi.EmbeddingRequest":{"properties":{"dimensions":{"description":"Dimensions is the number of dimensions the resulting output embeddings should have (optional)","type":"integer"},"encoding_format":{"description":"EncodingFormat is the format to return the embeddings in (optional: \"float\" or \"base64\")","type":"string"},"input":{"description":"Input text or tokens to embed (can be string, []string, []int, or [][]int)"},"model":{"description":"Model identifier in 'provider/model' format","type":"string"}},"required":["input","model"],"type":"object"},"llmapi.EmbeddingResponse":{"properties":{"data":{"description":"Data contains the embeddings","items":{"$ref":"#/components/schemas/llmapi.EmbeddingData"},"type":"array","uniqueItems":false},"extra_fields":{"$ref":"#/components/schemas/llmapi.EmbeddingExtraFields"},"model":{"description":"Model is the model used","type":"string"},"object":{"description":"Object is always \"list\"","type":"string"},"usage":{"$ref":"#/components/schemas/llmapi.EmbeddingUsage"}},"type":"object"},"llmapi.EmbeddingUsage":{"description":"Usage contains token usage information","properties":{"cost_micro_usd":{"description":"CostMicroUSD is the inference cost for this embedding request","type":"integer"},"prompt_tokens":{"description":"PromptTokens is the number of tokens in the prompt","type":"integer"},"total_tokens":{"description":"TotalTokens is the total number of tokens used","type":"integer"}},"type":"object"},"llmapi.ImageGenerationExtraFields":{"description":"ExtraFields contains additional metadata such as provider/model information.","properties":{"model_requested":{"description":"ModelRequested is the model identifier that the client asked for.","type":"string"},"provider":{"description":"Provider is the gateway that serviced this request.","type":"string"},"request_type":{"description":"RequestType is always \"image_generation\".","type":"string"}},"type":"object"},"llmapi.ImageGenerationImage":{"properties":{"b64_json":{"description":"B64JSON is the base64 payload for models that can only return binary.","type":"string"},"url":{"description":"URL is the signed URL to download the image.","type":"string"}},"type":"object"},"llmapi.ImageGenerationRequest":{"properties":{"model":{"description":"Model is the model identifier to use for generation (e.g., \"gpt-image-1\").","type":"string"},"prompt":{"description":"Prompt is the text description of the desired image.","type":"string"},"quality":{"description":"Quality targets a quality preset (e.g., \"auto\", \"high\").","type":"string"},"response_format":{"description":"ResponseFormat controls how the generated image is returned (e.g., \"url\" or \"b64_json\").","type":"string"},"size":{"description":"Size controls the dimensions of the generated image (e.g., \"1024x1024\").","type":"string"}},"required":["model","prompt"],"type":"object"},"llmapi.ImageGenerationResponse":{"properties":{"created":{"description":"Created is the Unix timestamp when the image was generated.","type":"integer"},"extra_fields":{"$ref":"#/components/schemas/llmapi.ImageGenerationExtraFields"},"images":{"description":"Images contains the generated images.","items":{"$ref":"#/components/schemas/llmapi.ImageGenerationImage"},"type":"array","uniqueItems":false},"model":{"description":"Model is the model identifier that generated the image.","type":"string"},"provider":{"description":"Provider is the gateway that produced the image.","type":"string"},"usage":{"$ref":"#/components/schemas/llmapi.ImageGenerationUsage"}},"type":"object"},"llmapi.ImageGenerationUsage":{"description":"Usage documents token usage (when available).","properties":{"cost_micro_usd":{"description":"CostMicroUSD is the inference cost for this image generation request","type":"integer"},"input_tokens":{"description":"InputTokens is the number of tokens sent in the prompt.","type":"integer"},"output_tokens":{"description":"OutputTokens is the number of tokens returned by the model.","type":"integer"},"total_tokens":{"description":"TotalTokens is the total number of tokens consumed.","type":"integer"}},"type":"object"},"llmapi.Message":{"description":"Message is the generated message","properties":{"content":{"description":"Content is the message content","items":{"$ref":"#/components/schemas/llmapi.MessageContentPart"},"type":"array","uniqueItems":false},"role":{"$ref":"#/components/schemas/llmapi.Role"},"tool_calls":{"description":"ToolCalls contains tool/function calls made by the assistant (only for assistant role)","items":{"$ref":"#/components/schemas/llmapi.ToolCall"},"type":"array","uniqueItems":false}},"type":"object"},"llmapi.MessageContentImage":{"description":"ImageURL is used when Type=image_url","properties":{"detail":{"description":"Detail is the OpenAI detail hint (auto|low|high)","type":"string"},"url":{"description":"URL is the image URL or data URI","type":"string"}},"type":"object"},"llmapi.MessageContentPart":{"properties":{"image_url":{"$ref":"#/components/schemas/llmapi.MessageContentImage"},"text":{"description":"Text holds the text content when Type=text","type":"string"},"type":{"description":"Type is the block type (`text` or `image_url`)","type":"string"}},"type":"object"},"llmapi.Model":{"properties":{"architecture":{"$ref":"#/components/schemas/llmapi.ModelArchitecture"},"canonical_slug":{"description":"CanonicalSlug is the canonical slug for the model","type":"string"},"context_length":{"description":"ContextLength is the maximum context length in tokens","type":"integer"},"created":{"description":"Created is the Unix timestamp of when the model was created","type":"integer"},"default_parameters":{"additionalProperties":{},"description":"DefaultParameters contains default parameter values","type":"object"},"description":{"description":"Description describes the model and its capabilities","type":"string"},"hugging_face_id":{"description":"HuggingFaceID is the Hugging Face model identifier","type":"string"},"id":{"description":"ID is the model identifier (e.g., \"openai/gpt-4\")","type":"string"},"max_input_tokens":{"description":"MaxInputTokens is the maximum input tokens","type":"integer"},"max_output_tokens":{"description":"MaxOutputTokens is the maximum output tokens","type":"integer"},"modalities":{"description":"Modalities is a list of supported modalities (e.g., [\"llm\", \"vision\"])","items":{"type":"string"},"type":"array","uniqueItems":false},"name":{"description":"Name is the human-readable model name (optional)","type":"string"},"owned_by":{"description":"OwnedBy is the organization that owns the model","type":"string"},"per_request_limits":{"$ref":"#/components/schemas/llmapi.ModelPerRequestLimits"},"pricing":{"$ref":"#/components/schemas/llmapi.ModelPricing"},"supported_methods":{"description":"SupportedMethods is a list of supported API methods","items":{"type":"string"},"type":"array","uniqueItems":false},"supported_parameters":{"description":"SupportedParameters is a list of supported parameter names","items":{"type":"string"},"type":"array","uniqueItems":false},"top_provider":{"$ref":"#/components/schemas/llmapi.ModelTopProvider"}},"type":"object"},"llmapi.ModelArchitecture":{"description":"Architecture describes the model's technical capabilities","properties":{"instruct_type":{"type":"string"},"modality":{"type":"string"},"prompt_formatting":{"type":"string"},"tokenizer":{"type":"string"}},"type":"object"},"llmapi.ModelPerRequestLimits":{"description":"PerRequestLimits contains rate limiting information","properties":{"completion_tokens":{"type":"integer"},"prompt_tokens":{"type":"integer"}},"type":"object"},"llmapi.ModelPricing":{"description":"Pricing contains the pricing structure for using this model","properties":{"completion":{"type":"string"},"image":{"type":"string"},"prompt":{"type":"string"},"request":{"type":"string"}},"type":"object"},"llmapi.ModelTopProvider":{"description":"TopProvider contains configuration details for the primary provider","properties":{"context_length":{"type":"integer"},"is_moderated":{"type":"boolean"},"max_completion_tokens":{"type":"integer"}},"type":"object"},"llmapi.ModelsListExtraFields":{"description":"ExtraFields contains additional metadata","properties":{"chunk_index":{"description":"ChunkIndex is the chunk index (0 for single requests)","type":"integer"},"latency":{"description":"Latency is the request latency in milliseconds","type":"integer"},"request_type":{"description":"RequestType is always \"list_models\"","type":"string"}},"type":"object"},"llmapi.ModelsListResponse":{"properties":{"data":{"description":"Data contains the list of available models","items":{"$ref":"#/components/schemas/llmapi.Model"},"type":"array","uniqueItems":false},"extra_fields":{"$ref":"#/components/schemas/llmapi.ModelsListExtraFields"},"next_page_token":{"description":"NextPageToken is the token to retrieve the next page of results (omitted if no more pages)","type":"string"}},"type":"object"},"llmapi.ResponseExtraFields":{"description":"ExtraFields contains additional metadata","properties":{"latency":{"description":"Latency is the request latency in milliseconds","type":"integer"},"model_requested":{"description":"ModelRequested is the model that was requested","type":"string"},"provider":{"description":"Provider is the LLM provider used (e.g., \"openai\", \"anthropic\")","type":"string"},"request_type":{"description":"RequestType is always \"responses\"","type":"string"}},"type":"object"},"llmapi.ResponseOutputContent":{"properties":{"text":{"description":"Text is the text content","type":"string"},"type":{"description":"Type is the content type (e.g., \"output_text\")","type":"string"}},"type":"object"},"llmapi.ResponseOutputItem":{"properties":{"arguments":{"description":"Arguments is the function arguments for function_call types","type":"string"},"call_id":{"description":"CallID is the call ID for function_call types","type":"string"},"content":{"description":"Content is the content array for message types","items":{"$ref":"#/components/schemas/llmapi.ResponseOutputContent"},"type":"array","uniqueItems":false},"id":{"description":"ID is the unique identifier for this output item","type":"string"},"name":{"description":"Name is the function name for function_call types","type":"string"},"role":{"description":"Role is the role for message types (e.g., \"assistant\")","type":"string"},"status":{"description":"Status is the status of this output item (e.g., \"completed\")","type":"string"},"type":{"description":"Type is the output item type (e.g., \"message\", \"function_call\")","type":"string"}},"type":"object"},"llmapi.ResponseRequest":{"properties":{"background":{"description":"Background indicates if request should be processed in background","type":"boolean"},"conversation":{"description":"Conversation is the conversation ID (optional)","type":"string"},"input":{"description":"Input is the simple text input for the response","type":"string"},"max_output_tokens":{"description":"MaxOutputTokens is the maximum number of tokens to generate","type":"integer"},"model":{"description":"Model is the model identifier in 'provider/model' format","type":"string"},"previous_response_id":{"description":"PreviousResponseID is the ID of a previous response to continue from","type":"string"},"store":{"description":"Store indicates if the response should be stored","type":"boolean"},"stream":{"description":"Stream indicates if response should be streamed","type":"boolean"},"temperature":{"description":"Temperature controls randomness (0.0 to 2.0)","type":"number"},"tool_choice":{"description":"ToolChoice controls which tool to use (auto, any, none, required, or tool name)","type":"string"},"tools":{"description":"Tools is an array of tool definitions (passed through, no MCP loop)","items":{"$ref":"#/components/schemas/llmapi.Tool"},"type":"array","uniqueItems":false}},"required":["input","model"],"type":"object"},"llmapi.ResponseResponse":{"properties":{"created_at":{"description":"Created is the Unix timestamp of creation (created_at in OpenAI format)","type":"integer"},"extra_fields":{"$ref":"#/components/schemas/llmapi.ResponseExtraFields"},"id":{"description":"ID is the unique response identifier","type":"string"},"model":{"description":"Model is the model used for generation","type":"string"},"object":{"description":"Object is the response type (e.g., \"response\")","type":"string"},"output":{"description":"Output is the array of output items (OpenAI Responses API format)","items":{"$ref":"#/components/schemas/llmapi.ResponseOutputItem"},"type":"array","uniqueItems":false},"usage":{"$ref":"#/components/schemas/llmapi.ResponseUsage"}},"type":"object"},"llmapi.ResponseUsage":{"description":"Usage contains token usage information","properties":{"completion_tokens":{"description":"CompletionTokens is the number of tokens in the completion","type":"integer"},"cost_micro_usd":{"description":"CostMicroUSD is the cost of this response in micro-dollars (USD × 1,000,000)","type":"integer"},"prompt_tokens":{"description":"PromptTokens is the number of tokens in the prompt","type":"integer"},"total_tokens":{"description":"TotalTokens is the total number of tokens used","type":"integer"}},"type":"object"},"llmapi.Role":{"description":"Role is the message role (system, user, assistant)","type":"string","x-enum-varnames":["RoleAssistant","RoleUser","RoleSystem"]},"llmapi.SearchExtraFields":{"description":"ExtraFields contains additional metadata.","properties":{"request_type":{"description":"RequestType is always \"search\".","type":"string"},"search_provider":{"description":"SearchProvider is the search provider used (e.g., \"perplexity\", \"google-pse\").","type":"string"}},"type":"object"},"llmapi.SearchRequest":{"properties":{"country":{"description":"Country code filter (e.g., \"US\", \"GB\", \"DE\").","type":"string"},"max_results":{"description":"Maximum number of results to return (1-20). Default: 10.","type":"integer"},"max_tokens_per_page":{"description":"Maximum tokens per page to process. Default: 1024.","type":"integer"},"query":{"description":"Search query. Can be a single string or array of strings.","items":{"type":"string"},"type":"array","uniqueItems":false},"search_domain_filter":{"description":"List of domains to filter results (max 20 domains).","items":{"type":"string"},"type":"array","uniqueItems":false},"search_tool_name":{"description":"The search provider to use.","type":"string"}},"required":["query","search_tool_name"],"type":"object"},"llmapi.SearchResponse":{"properties":{"extra_fields":{"$ref":"#/components/schemas/llmapi.SearchExtraFields"},"results":{"description":"List of search results.","items":{"$ref":"#/components/schemas/llmapi.SearchResult"},"type":"array","uniqueItems":false},"usage":{"$ref":"#/components/schemas/llmapi.SearchUsage"}},"type":"object"},"llmapi.SearchResult":{"properties":{"date":{"description":"Optional publication or last updated date.","type":"string"},"snippet":{"description":"Text snippet from the result.","type":"string"},"title":{"description":"Title of the search result.","type":"string"},"url":{"description":"URL of the search result.","type":"string"}},"type":"object"},"llmapi.SearchUsage":{"description":"Usage contains usage information.","properties":{"cost_micro_usd":{"description":"CostMicroUSD is the cost of this search in micro-dollars (USD × 1,000,000).","type":"integer"}},"type":"object"},"llmapi.Tool":{"properties":{"function":{"$ref":"#/components/schemas/llmapi.ToolFunction"},"type":{"description":"Type is the tool type (function, code_interpreter, file_search, web_search)","type":"string"}},"type":"object"},"llmapi.ToolCall":{"properties":{"function":{"$ref":"#/components/schemas/llmapi.ToolCallFunction"},"id":{"description":"ID is the unique identifier for this tool call","type":"string"},"type":{"description":"Type is the type of tool call (always \"function\" for now)","type":"string"}},"type":"object"},"llmapi.ToolCallFunction":{"description":"Function contains the function call details","properties":{"arguments":{"description":"Arguments is the JSON string of arguments to pass to the function","type":"string"},"name":{"description":"Name is the name of the function to call","type":"string"}},"type":"object"},"llmapi.ToolFunction":{"description":"Function is the function definition (when Type is \"function\")","properties":{"arguments":{"additionalProperties":{},"description":"Arguments is the function arguments schema (JSON object)","type":"object"},"name":{"description":"Name is the function name","type":"string"}},"type":"object"},"response.ErrorResponse":{"properties":{"error":{"type":"string"}},"type":"object"}}},
3
3
  "info": {"title":"","version":""},
4
4
  "externalDocs": {"description":"","url":""},
5
- "paths": {"/api/v1/chat/completions":{"post":{"description":"Generates a chat completion using the configured gateway. Supports streaming when stream=true.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.ChatCompletionRequest"}}},"description":"Chat completion request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/llmapi.ChatCompletionResponse"},{"type":"string"}]}},"text/event-stream":{"schema":{"type":"string"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create chat completion","tags":["Chat"]}},"/api/v1/docs/swagger.json":{"get":{"description":"Returns the OpenAPI 3.1 specification for this API","responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":{},"type":"object"}}},"description":"OK"}},"summary":"Get OpenAPI specification","tags":["Documentation"]}},"/api/v1/embeddings":{"post":{"description":"Generates embeddings using the configured gateway.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.EmbeddingRequest"}}},"description":"Embedding request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.EmbeddingResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create embeddings","tags":["Embeddings"]}},"/api/v1/images/generations":{"post":{"description":"Generates images using the configured LLM gateway.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.ImageGenerationRequest"}}},"description":"Image generation request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.ImageGenerationResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"},"501":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Not Implemented"}},"summary":"Generate images","tags":["Images"]}},"/api/v1/models":{"get":{"description":"Returns a list of all available models from the configured gateway with optional filters. Models include modality information indicating their capabilities (e.g., llm, embedding, vision, image, audio, reasoning, code, reranker, multimodal, video).","parameters":[{"description":"Filter by provider (e.g., openai, anthropic)","in":"query","name":"provider","schema":{"type":"string"}},{"description":"Number of models to return per page","in":"query","name":"page_size","schema":{"type":"integer"}},{"description":"Token to get next page of results","in":"query","name":"page_token","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.ModelsListResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List available models","tags":["Models"]}},"/api/v1/responses":{"post":{"description":"Generates a response using the Responses API format. Supports streaming when stream=true.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.ResponseRequest"}}},"description":"Response request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/llmapi.ResponseResponse"},{"type":"string"}]}},"text/event-stream":{"schema":{"type":"string"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create response","tags":["Chat"]}},"/api/v1/search":{"post":{"description":"Returns a list of ranked search results","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.SearchRequest"}}},"description":"Search request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.SearchResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create search","tags":["Search"]}},"/auth/oauth/{provider}/exchange":{"post":{"description":"Exchanges an OAuth authorization code for access and refresh tokens","parameters":[{"description":"OAuth provider (google-drive, dropbox)","in":"path","name":"provider","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.ExchangeRequest"}}},"description":"Exchange request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.TokenResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Exchange authorization code for tokens","tags":["OAuth"]}},"/auth/oauth/{provider}/refresh":{"post":{"description":"Refreshes an expired access token using a refresh token","parameters":[{"description":"OAuth provider (google-drive, dropbox)","in":"path","name":"provider","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.RefreshRequest"}}},"description":"Refresh request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.TokenResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Refresh access token","tags":["OAuth"]}},"/auth/oauth/{provider}/revoke":{"post":{"description":"Revokes an OAuth access or refresh token","parameters":[{"description":"OAuth provider (google-drive, dropbox)","in":"path","name":"provider","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.RevokeRequest"}}},"description":"Revoke request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":{},"type":"object"}}},"description":"Empty object on success"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Revoke OAuth token","tags":["OAuth"]}},"/health":{"get":{"description":"Returns the current health status of the service.","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.HealthResponse"}}},"description":"OK"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Health check","tags":["Health"]}}},
5
+ "paths": {"/api/v1/chat/completions":{"post":{"description":"Generates a chat completion using the configured gateway. Supports streaming when stream=true.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.ChatCompletionRequest"}}},"description":"Chat completion request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/llmapi.ChatCompletionResponse"},{"type":"string"}]}},"text/event-stream":{"schema":{"type":"string"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create chat completion","tags":["Chat"]}},"/api/v1/config":{"get":{"description":"Returns public configuration including contract addresses and payment model","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.ConfigResponse"}}},"description":"OK"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Get configuration","tags":["Configuration"]}},"/api/v1/docs/swagger.json":{"get":{"description":"Returns the OpenAPI 3.1 specification for this API","responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":{},"type":"object"}}},"description":"OK"}},"summary":"Get OpenAPI specification","tags":["Documentation"]}},"/api/v1/embeddings":{"post":{"description":"Generates embeddings using the configured gateway.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.EmbeddingRequest"}}},"description":"Embedding request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.EmbeddingResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create embeddings","tags":["Embeddings"]}},"/api/v1/images/generations":{"post":{"description":"Generates images using the configured LLM gateway.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.ImageGenerationRequest"}}},"description":"Image generation request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.ImageGenerationResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"},"501":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Not Implemented"}},"summary":"Generate images","tags":["Images"]}},"/api/v1/models":{"get":{"description":"Returns a list of all available models from the configured gateway with optional filters. Models include modality information indicating their capabilities (e.g., llm, embedding, vision, image, audio, reasoning, code, reranker, multimodal, video).","parameters":[{"description":"Filter by provider (e.g., openai, anthropic)","in":"query","name":"provider","schema":{"type":"string"}},{"description":"Number of models to return per page","in":"query","name":"page_size","schema":{"type":"integer"}},{"description":"Token to get next page of results","in":"query","name":"page_token","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.ModelsListResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List available models","tags":["Models"]}},"/api/v1/responses":{"post":{"description":"Generates a response using the Responses API format. Supports streaming when stream=true.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.ResponseRequest"}}},"description":"Response request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/llmapi.ResponseResponse"},{"type":"string"}]}},"text/event-stream":{"schema":{"type":"string"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create response","tags":["Chat"]}},"/api/v1/search":{"post":{"description":"Returns a list of ranked search results","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.SearchRequest"}}},"description":"Search request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/llmapi.SearchResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create search","tags":["Search"]}},"/auth/oauth/{provider}/exchange":{"post":{"description":"Exchanges an OAuth authorization code for access and refresh tokens","parameters":[{"description":"OAuth provider (google-drive, dropbox)","in":"path","name":"provider","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.ExchangeRequest"}}},"description":"Exchange request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.TokenResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Exchange authorization code for tokens","tags":["OAuth"]}},"/auth/oauth/{provider}/refresh":{"post":{"description":"Refreshes an expired access token using a refresh token","parameters":[{"description":"OAuth provider (google-drive, dropbox)","in":"path","name":"provider","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.RefreshRequest"}}},"description":"Refresh request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.TokenResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Refresh access token","tags":["OAuth"]}},"/auth/oauth/{provider}/revoke":{"post":{"description":"Revokes an OAuth access or refresh token","parameters":[{"description":"OAuth provider (google-drive, dropbox)","in":"path","name":"provider","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.RevokeRequest"}}},"description":"Revoke request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":{},"type":"object"}}},"description":"Empty object on success"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Revoke OAuth token","tags":["OAuth"]}},"/health":{"get":{"description":"Returns the current health status of the service.","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.HealthResponse"}}},"description":"OK"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Health check","tags":["Health"]}}},
6
6
  "openapi": "3.1.0"
7
7
  }