@reverbia/portal 1.0.0-next.20260120014936 → 1.0.0-next.20260121030221
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.
- package/package.json +1 -1
- 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.
|
|
3
|
+
"version": "1.0.0-next.20260121030221",
|
|
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.CancelSubscriptionResponse":{"properties":{"cancel_at":{"type":"integer"},"current_period_end":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"handlers.CheckoutSessionResponse":{"properties":{"url":{"type":"string"}},"type":"object"},"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.CreateCheckoutSessionRequest":{"properties":{"cancel_url":{"type":"string"},"success_url":{"type":"string"}},"type":"object"},"handlers.CreateCustomerPortalRequest":{"properties":{"return_url":{"type":"string"}},"type":"object"},"handlers.CustomerPortalResponse":{"properties":{"url":{"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.RenewSubscriptionResponse":{"properties":{"current_period_end":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"handlers.RevokeRequest":{"properties":{"token":{"type":"string"}},"required":["token"],"type":"object"},"handlers.SubscriptionStatusResponse":{"properties":{"cancel_at_period_end":{"description":"true if scheduled to cancel","type":"boolean"},"current_period_end":{"description":"Unix timestamp, only present if subscribed","type":"integer"},"plan":{"description":"\"free\" | \"pro\"","type":"string"},"status":{"description":"\"none\" | \"active\" | \"canceling\" | \"past_due\" | \"canceled\"","type":"string"}},"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"},"tool_choice":{"$ref":"#/components/schemas/llmapi.ToolChoice"},"tools":{"description":"Tools is an array of tool definitions the model can use","items":{"$ref":"#/components/schemas/llmapi.Tool"},"type":"array","uniqueItems":false}},"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"},"messages":{"description":"Messages contains the full conversation history when local tools need execution.\nThis is populated when the model requests tools that are not MCP tools (local/client-side tools).\nThe client should execute these tools and send a new request with this message history\nplus the tool results appended.","items":{"$ref":"#/components/schemas/llmapi.Message"},"type":"array","uniqueItems":false},"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.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_call_id":{"description":"ToolCallID is the ID of the tool call this message is responding to (only for tool role)","type":"string"},"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":{"description":"Type is the message type (for Responses API: \"message\")","type":"string"}},"type":"object"},"llmapi.MessageContentFile":{"description":"File is used when Type=input_file (for Responses API)","properties":{"file_data":{"description":"FileData is the base64-encoded file content","type":"string"},"file_id":{"description":"FileID is the ID of an uploaded file","type":"string"},"file_url":{"description":"FileURL is the URL to the file","type":"string"},"filename":{"description":"Filename is the name of the file","type":"string"}},"type":"object"},"llmapi.MessageContentImage":{"description":"ImageURL is used when Type=image_url or Type=input_image","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":{"file":{"$ref":"#/components/schemas/llmapi.MessageContentFile"},"image_url":{"$ref":"#/components/schemas/llmapi.MessageContentImage"},"text":{"description":"Text holds the text content when Type=text or Type=input_text","type":"string"},"type":{"description":"Type is the block type (`text`, `image_url`, or `input_file`)","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.ResponseInput":{"description":"Input can be a simple text string or an array of messages for multi-turn conversations.\nWhen continuing after client tool calls, pass the messages array from the previous response.","properties":{"messages":{"description":"Messages is set when input is an array of messages (for multi-turn/tool continuations)","items":{"$ref":"#/components/schemas/llmapi.Message"},"type":"array"},"text":{"description":"Text is set when input is a simple string","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 and reasoning 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"},"summary":{"description":"Summary is the reasoning summary for reasoning types","items":{"$ref":"#/components/schemas/llmapi.ResponseOutputContent"},"type":"array","uniqueItems":false},"type":{"description":"Type is the output item type (e.g., \"message\", \"function_call\", \"reasoning\")","type":"string"}},"type":"object"},"llmapi.ResponseReasoning":{"description":"Reasoning configures reasoning for o-series and other reasoning models","properties":{"effort":{"description":"Effort controls reasoning effort: \"low\", \"medium\", or \"high\"","type":"string"},"summary":{"description":"Summary controls reasoning summary: \"auto\", \"concise\", or \"detailed\"","type":"string"}},"type":"object"},"llmapi.ResponseRequest":{"properties":{"background":{"description":"Background indicates if request should be processed in background","type":"boolean"},"input":{"$ref":"#/components/schemas/llmapi.ResponseInput"},"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"},"reasoning":{"$ref":"#/components/schemas/llmapi.ResponseReasoning"},"stream":{"description":"Stream indicates if response should be streamed","type":"boolean"},"temperature":{"description":"Temperature controls randomness (0.0 to 2.0)","type":"number"},"thinking":{"$ref":"#/components/schemas/llmapi.ThinkingOptions"},"tool_choice":{"$ref":"#/components/schemas/llmapi.ToolChoice"},"tools":{"description":"Tools is an array of tool definitions the model can use","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"},"messages":{"description":"Messages contains the full conversation history when local tools need execution.\nThis is populated when the model requests tools that are not MCP tools (local/client-side tools).\nThe client should execute these tools and send a new request with this message history\nplus the tool results appended.","items":{"$ref":"#/components/schemas/llmapi.Message"},"type":"array","uniqueItems":false},"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, tool)","type":"string","x-enum-varnames":["RoleAssistant","RoleUser","RoleSystem","RoleTool"]},"llmapi.ThinkingOptions":{"description":"Thinking configures extended thinking for Anthropic models","properties":{"budget_tokens":{"description":"BudgetTokens is the token budget for thinking","type":"integer"},"type":{"description":"Type indicates if thinking is enabled: \"enabled\" or \"disabled\"","type":"string"}},"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.ToolChoice":{"description":"ToolChoice controls which tool to use. Can be:\n- string: \"auto\", \"none\", \"required\"\n- object: {\"name\": \"my_function\"}","properties":{"function":{"$ref":"#/components/schemas/llmapi.ToolChoiceFunction"},"mode":{"$ref":"#/components/schemas/llmapi.ToolChoiceMode"},"tag":{"$ref":"#/components/schemas/llmapi.ToolChoiceTag"}},"type":"object"},"llmapi.ToolChoiceFunction":{"description":"Function forces the model to call a specific tool function.","properties":{"name":{"type":"string"}},"type":"object"},"llmapi.ToolChoiceMode":{"description":"Mode controls which (if any) tool is called by the model.\n- \"none\" means the model will not call any tool and instead generates a message.\n- \"auto\" means the model can pick between generating a message or calling one or more tools.\n- \"required\" means the model must call one or more tools.","enum":["none","auto","required"],"type":"string","x-enum-varnames":["ToolChoiceModeNone","ToolChoiceModeAuto","ToolChoiceModeRequired"]},"llmapi.ToolChoiceTag":{"enum":[0,1],"type":"integer","x-enum-varnames":["ToolChoiceTagMode","ToolChoiceTagFunction"]},"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"},"description":{"description":"Description is a description of the function (used by the model to decide when to call it)","type":"string"},"name":{"description":"Name is the function name","type":"string"}},"type":"object"},"response.ErrorResponse":{"properties":{"error":{"type":"string"},"request_id":{"type":"string"},"trace_id":{"type":"string"}},"type":"object"}}},
|
|
2
|
+
"components": {"schemas":{"handlers.CancelSubscriptionResponse":{"properties":{"cancel_at":{"type":"integer"},"current_period_end":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"handlers.CheckoutSessionResponse":{"properties":{"url":{"type":"string"}},"type":"object"},"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.CreateCheckoutSessionRequest":{"properties":{"cancel_url":{"type":"string"},"success_url":{"type":"string"}},"type":"object"},"handlers.CreateCustomerPortalRequest":{"properties":{"return_url":{"type":"string"}},"type":"object"},"handlers.CustomerPortalResponse":{"properties":{"url":{"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.RenewSubscriptionResponse":{"properties":{"current_period_end":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"handlers.RevokeRequest":{"properties":{"token":{"type":"string"}},"required":["token"],"type":"object"},"handlers.SubscriptionStatusResponse":{"properties":{"cancel_at_period_end":{"description":"true if scheduled to cancel","type":"boolean"},"current_period_end":{"description":"Unix timestamp, only present if subscribed","type":"integer"},"plan":{"description":"\"free\" | \"pro\"","type":"string"},"status":{"description":"\"none\" | \"active\" | \"canceling\" | \"past_due\" | \"canceled\"","type":"string"}},"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"},"tool_choice":{"$ref":"#/components/schemas/llmapi.ChatCompletionToolChoice"},"tools":{"description":"Tools is an array of tool schemas describing which tools the model can use","items":{"$ref":"#/components/schemas/llmapi.ChatCompletionTool"},"type":"array","uniqueItems":false}},"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"},"messages":{"description":"Messages contains the full conversation history when local tools need execution.\nThis is populated when the model requests tools that are not MCP tools (local/client-side tools).\nThe client should execute these tools and send a new request with this message history\nplus the tool results appended.","items":{"$ref":"#/components/schemas/llmapi.Message"},"type":"array","uniqueItems":false},"model":{"description":"Model is the model used","type":"string"},"usage":{"$ref":"#/components/schemas/llmapi.ChatCompletionUsage"}},"type":"object"},"llmapi.ChatCompletionTool":{"type":"object"},"llmapi.ChatCompletionToolChoice":{"description":"ToolChoice controls tool usage","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.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_call_id":{"description":"ToolCallID is the ID of the tool call this message is responding to (only for tool role)","type":"string"},"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":{"description":"Type is the message type (for Responses API: \"message\")","type":"string"}},"type":"object"},"llmapi.MessageContentFile":{"description":"File is used when Type=input_file (for Responses API)","properties":{"file_data":{"description":"FileData is the base64-encoded file content","type":"string"},"file_id":{"description":"FileID is the ID of an uploaded file","type":"string"},"file_url":{"description":"FileURL is the URL to the file","type":"string"},"filename":{"description":"Filename is the name of the file","type":"string"}},"type":"object"},"llmapi.MessageContentImage":{"description":"ImageURL is used when Type=image_url or Type=input_image","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":{"file":{"$ref":"#/components/schemas/llmapi.MessageContentFile"},"image_url":{"$ref":"#/components/schemas/llmapi.MessageContentImage"},"text":{"description":"Text holds the text content when Type=text or Type=input_text","type":"string"},"type":{"description":"Type is the block type (`text`, `image_url`, or `input_file`)","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.ResponseInput":{"description":"Input can be a simple text string or an array of messages for multi-turn conversations.\nWhen continuing after client tool calls, pass the messages array from the previous response.","properties":{"messages":{"description":"Messages is set when input is an array of messages (for multi-turn/tool continuations)","items":{"$ref":"#/components/schemas/llmapi.Message"},"type":"array"},"text":{"description":"Text is set when input is a simple string","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 and reasoning 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"},"summary":{"description":"Summary is the reasoning summary for reasoning types","items":{"$ref":"#/components/schemas/llmapi.ResponseOutputContent"},"type":"array","uniqueItems":false},"type":{"description":"Type is the output item type (e.g., \"message\", \"function_call\", \"reasoning\")","type":"string"}},"type":"object"},"llmapi.ResponseReasoning":{"description":"Reasoning configures reasoning for o-series and other reasoning models","properties":{"effort":{"description":"Effort controls reasoning effort: \"low\", \"medium\", or \"high\"","type":"string"},"summary":{"description":"Summary controls reasoning summary: \"auto\", \"concise\", or \"detailed\"","type":"string"}},"type":"object"},"llmapi.ResponseRequest":{"properties":{"background":{"description":"Background indicates if request should be processed in background","type":"boolean"},"input":{"$ref":"#/components/schemas/llmapi.ResponseInput"},"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"},"reasoning":{"$ref":"#/components/schemas/llmapi.ResponseReasoning"},"stream":{"description":"Stream indicates if response should be streamed","type":"boolean"},"temperature":{"description":"Temperature controls randomness (0.0 to 2.0)","type":"number"},"thinking":{"$ref":"#/components/schemas/llmapi.ThinkingOptions"},"tool_choice":{"$ref":"#/components/schemas/llmapi.ResponseToolChoice"},"tools":{"description":"Tools is an array of tool schemas describing which tools the model can use","items":{"$ref":"#/components/schemas/llmapi.ResponseTool"},"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"},"messages":{"description":"Messages contains the full conversation history when local tools need execution.\nThis is populated when the model requests tools that are not MCP tools (local/client-side tools).\nThe client should execute these tools and send a new request with this message history\nplus the tool results appended.","items":{"$ref":"#/components/schemas/llmapi.Message"},"type":"array","uniqueItems":false},"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.ResponseTool":{"type":"object"},"llmapi.ResponseToolChoice":{"description":"ToolChoice controls tool usage","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, tool)","type":"string","x-enum-varnames":["RoleAssistant","RoleUser","RoleSystem","RoleTool"]},"llmapi.ThinkingOptions":{"description":"Thinking configures extended thinking for Anthropic models","properties":{"budget_tokens":{"description":"BudgetTokens is the token budget for thinking","type":"integer"},"type":{"description":"Type indicates if thinking is enabled: \"enabled\" or \"disabled\"","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"},"response.ErrorResponse":{"properties":{"error":{"type":"string"},"request_id":{"type":"string"},"trace_id":{"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"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Model provider rate limit exceeded"},"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"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Model provider rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create embeddings","tags":["Embeddings"]}},"/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"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Rate limit exceeded"},"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"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Model provider rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create response","tags":["Chat"]}},"/api/v1/subscriptions/cancel":{"post":{"description":"Cancels the user's subscription at the end of the current billing period (cancel_at_period_end)","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.CancelSubscriptionResponse"}}},"description":"OK"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"BearerAuth":[]}],"summary":"Cancel subscription","tags":["Subscriptions"]}},"/api/v1/subscriptions/create-checkout-session":{"post":{"description":"Creates a Stripe Checkout Session for Pro subscription and returns the checkout URL","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.CreateCheckoutSessionRequest"}}},"description":"Checkout session request with redirect URLs","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.CheckoutSessionResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"BearerAuth":[]}],"summary":"Create checkout session","tags":["Subscriptions"]}},"/api/v1/subscriptions/customer-portal":{"post":{"description":"Creates a Stripe Customer Portal session for managing subscription and returns the portal URL","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.CreateCustomerPortalRequest"}}},"description":"Customer portal request with return URL","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.CustomerPortalResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"BearerAuth":[]}],"summary":"Create customer portal session","tags":["Subscriptions"]}},"/api/v1/subscriptions/renew":{"post":{"description":"Reactivates a subscription that was scheduled for cancellation (undoes cancel_at_period_end)","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.RenewSubscriptionResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"BearerAuth":[]}],"summary":"Renew subscription","tags":["Subscriptions"]}},"/api/v1/subscriptions/status":{"get":{"description":"Returns the current subscription status, plan, and billing period info","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.SubscriptionStatusResponse"}}},"description":"OK"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"BearerAuth":[]}],"summary":"Get subscription status","tags":["Subscriptions"]}},"/api/v1/subscriptions/webhook":{"post":{"description":"Receives and processes Stripe webhook events for subscription lifecycle management","parameters":[{"description":"Stripe webhook signature","in":"header","name":"Stripe-Signature","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"}},"summary":"Handle Stripe webhook","tags":["Subscriptions"]}},"/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"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Model provider rate limit exceeded"},"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"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Model provider rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create embeddings","tags":["Embeddings"]}},"/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"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Rate limit exceeded"},"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"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Model provider rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Create response","tags":["Chat"]}},"/api/v1/subscriptions/cancel":{"post":{"description":"Cancels the user's subscription at the end of the current billing period (cancel_at_period_end)","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.CancelSubscriptionResponse"}}},"description":"OK"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"BearerAuth":[]}],"summary":"Cancel subscription","tags":["Subscriptions"]}},"/api/v1/subscriptions/create-checkout-session":{"post":{"description":"Creates a Stripe Checkout Session for Pro subscription and returns the checkout URL","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.CreateCheckoutSessionRequest"}}},"description":"Checkout session request with redirect URLs","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.CheckoutSessionResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"BearerAuth":[]}],"summary":"Create checkout session","tags":["Subscriptions"]}},"/api/v1/subscriptions/customer-portal":{"post":{"description":"Creates a Stripe Customer Portal session for managing subscription and returns the portal URL","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.CreateCustomerPortalRequest"}}},"description":"Customer portal request with return URL","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.CustomerPortalResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"BearerAuth":[]}],"summary":"Create customer portal session","tags":["Subscriptions"]}},"/api/v1/subscriptions/renew":{"post":{"description":"Reactivates a subscription that was scheduled for cancellation (undoes cancel_at_period_end)","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.RenewSubscriptionResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"BearerAuth":[]}],"summary":"Renew subscription","tags":["Subscriptions"]}},"/api/v1/subscriptions/status":{"get":{"description":"Returns the current subscription status, plan, and billing period info","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/handlers.SubscriptionStatusResponse"}}},"description":"OK"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"BearerAuth":[]}],"summary":"Get subscription status","tags":["Subscriptions"]}},"/api/v1/subscriptions/webhook":{"post":{"description":"Receives and processes Stripe webhook events for subscription lifecycle management","parameters":[{"description":"Stripe webhook signature","in":"header","name":"Stripe-Signature","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Bad Request"}},"summary":"Handle Stripe webhook","tags":["Subscriptions"]}},"/api/v1/tools":{"get":{"description":"Returns a map of available MCP tool schemas indexed by tool name.","responses":{"200":{"content":{"application/json":{"schema":{"type":"map"}}},"description":"OK"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/response.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List available tools","tags":["Tools"]}},"/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
|
}
|