{"components":{"responses":{},"schemas":{"ChatMessage":{"properties":{"content":{"type":"string"},"id":{"description":"Message CUID","type":"string"},"insertedAt":{"format":"date-time","type":"string"},"role":{"enum":["user","assistant","system"],"type":"string"}},"required":["id","role","content"],"title":"ChatMessage","type":"object"},"RegisterRequest":{"properties":{"email":{"format":"email","type":"string"},"password":{"format":"password","minLength":8,"type":"string"}},"required":["email","password"],"title":"RegisterRequest","type":"object"},"MediaUploadResponse":{"properties":{"attachment_id":{"description":"Attachment ID","type":"string"},"gallery_id":{"nullable":true,"type":"string"},"id":{"description":"Photo ID","type":"string"},"ok":{"type":"boolean"}},"title":"MediaUploadResponse","type":"object"},"CreateConversationRequest":{"properties":{"model":{"description":"LLM model to use","type":"string"},"title":{"description":"Conversation title (max 80 chars)","type":"string"}},"title":"CreateConversationRequest","type":"object"},"BrokerAccountPending":{"properties":{"status":{"enum":["pending"],"type":"string"}},"required":["status"],"title":"BrokerAccountPending","type":"object"},"AuthResponse":{"properties":{"access_token":{"description":"JWT access token (24h TTL)","type":"string"},"api_key":{"description":"Default API key (on register)","nullable":true,"type":"string"},"refresh_token":{"description":"JWT refresh token (30d TTL)","type":"string"},"user":{"$ref":"#/components/schemas/UserProfile"}},"title":"AuthResponse","type":"object"},"BrokerRouting":{"description":"Narrows which offer serves the request. Never loosens product guarantees. No matching offer → 409 no_matching_offer.","example":{"category":"coding","min_score":0.8,"region":"eu","sort":"value"},"properties":{"capabilities":{"description":"Every chosen provider must support all of these","oneOf":[{"enum":["reasoning","structured_output","tools","vision"],"type":"string"},{"items":{"enum":["reasoning","structured_output","tools","vision"],"type":"string"},"type":"array"}]},"category":{"description":"Use case for level, min_score and sort=score|value","enum":["coding","instruction_following","math","reasoning"],"type":"string"},"family":{"description":"Model family: vendor (anthropic), name start (claude, qwen3) or id prefix (deepseek/deepseek-v4). New generations are included automatically.","type":"string"},"level":{"description":"Needs category. solid/strong/top = the threshold of that level; best = only the offer with the highest measured score in category (within all other filters). Not together with min_score. Also for taylor (overrides the key's level for this request).","enum":["solid","strong","top","best"],"type":"string"},"max_price":{"description":"Customer price cap in CHF per 1M tokens (incl. our margin)","properties":{"input":{"type":"number"},"output":{"type":"number"}},"type":"object"},"min_context":{"description":"Minimum context window (tokens)","minimum":1,"type":"integer"},"min_score":{"description":"Only offers whose score in category (our own measurement) is at least this","maximum":1,"minimum":0,"type":"number"},"region":{"description":"Execution location of the provider (eu includes ch)","oneOf":[{"enum":["ch","eu","us","asia","global"],"type":"string"},{"items":{"enum":["ch","eu","us","asia","global"],"type":"string"},"type":"array"}]},"sort":{"default":"price","description":"cheapest · best score per CHF · highest throughput · highest score","enum":["price","value","speed","score"],"type":"string"}},"title":"BrokerRouting","type":"object"},"A2AAgentCard":{"properties":{"capabilities":{"type":"object"},"description":{"type":"string"},"name":{"type":"string"},"protocolVersion":{"type":"string"},"skills":{"items":{"type":"object"},"type":"array"},"url":{"format":"uri","type":"string"},"version":{"type":"string"}},"required":["name","url"],"title":"A2AAgentCard","type":"object"},"LoginRequest":{"properties":{"email":{"format":"email","type":"string"},"password":{"format":"password","type":"string"}},"required":["email","password"],"title":"LoginRequest","type":"object"},"A2AJsonRpcRequest":{"properties":{"id":{"oneOf":[{"type":"integer"},{"type":"string"}]},"jsonrpc":{"enum":["2.0"],"type":"string"},"method":{"description":"JSON-RPC method name","enum":["message/send","message/stream","tasks/get","tasks/cancel","tasks/resubscribe"],"type":"string"},"params":{"description":"Method parameters","type":"object"}},"required":["jsonrpc","method"],"title":"A2AJsonRpcRequest","type":"object"},"BrokerBillingStatus":{"properties":{"balance_chf":{"type":"string"},"billed_until":{"format":"date","nullable":true,"type":"string"},"billing":{"enum":["topup","monthly"],"type":"string"},"blocked_reason":{"nullable":true,"type":"string"},"card":{"nullable":true,"properties":{"brand":{"type":"string"},"expires":{"type":"string"},"last4":{"type":"string"}},"type":"object"},"card_setup_pending":{"type":"boolean"},"credit_limit_chf":{"type":"string"},"month_spent_chf":{"type":"string"},"topup":{"description":"Only for billing=topup, otherwise false.","nullable":true,"oneOf":[{"type":"boolean"},{"properties":{"amount_chf":{"nullable":true,"type":"string"},"enabled":{"type":"boolean"},"threshold_chf":{"nullable":true,"type":"string"}},"type":"object"}]}},"title":"BrokerBillingStatus","type":"object"},"SendMessageResponse":{"properties":{"conversationId":{"nullable":true,"type":"string"},"pipelineRunId":{"nullable":true,"type":"string"},"reply":{"description":"Assistant reply text","type":"string"},"usage":{"description":"Token usage statistics","type":"object"}},"title":"SendMessageResponse","type":"object"},"ApiKeyItem":{"properties":{"enabled":{"type":"boolean"},"expiresAt":{"format":"date-time","nullable":true,"type":"string"},"id":{"type":"string"},"insertedAt":{"format":"date-time","type":"string"},"lastUsedAt":{"format":"date-time","nullable":true,"type":"string"},"name":{"type":"string"}},"title":"ApiKeyItem","type":"object"},"UserProfile":{"properties":{"created_at":{"format":"date-time","type":"string"},"display_name":{"nullable":true,"type":"string"},"email":{"format":"email","type":"string"},"id":{"type":"string"},"role":{"enum":["user","admin"],"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","email"],"title":"UserProfile","type":"object"},"UpdateUserRequest":{"properties":{"avatar_url":{"nullable":true,"type":"string"},"bio":{"nullable":true,"type":"string"},"display_name":{"nullable":true,"type":"string"},"locale":{"nullable":true,"type":"string"},"timezone":{"nullable":true,"type":"string"}},"title":"UpdateUserRequest","type":"object"},"Conversation":{"properties":{"id":{"description":"Conversation CUID","type":"string"},"model":{"description":"LLM model used for this conversation","type":"string"},"title":{"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id"],"title":"Conversation","type":"object"},"ApiKeyListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ApiKeyItem"},"type":"array"}},"title":"ApiKeyListResponse","type":"object"},"WalletTransaction":{"properties":{"amount":{"description":"Decimal amount as string","type":"string"},"balanceAfter":{"description":"Balance after transaction","type":"string"},"id":{"type":"string"},"insertedAt":{"format":"date-time","type":"string"},"reference":{"nullable":true,"type":"string"},"type":{"type":"string"}},"title":"WalletTransaction","type":"object"},"RagSearchResponse":{"properties":{"citations":{"items":{"type":"object"},"nullable":true,"type":"array"},"ok":{"type":"boolean"},"retrieved":{"description":"Number of retrieved documents","type":"integer"},"system_message":{"items":{"type":"string"},"type":"array"}},"title":"RagSearchResponse","type":"object"},"HealthResponse":{"properties":{"status":{"enum":["ok","degraded","error"],"type":"string"},"uptime_seconds":{"nullable":true,"type":"integer"},"version":{"nullable":true,"type":"string"}},"title":"HealthResponse","type":"object"},"ChatCompletionRequest":{"properties":{"frequency_penalty":{"type":"number"},"max_completion_tokens":{"description":"Same as max_tokens","type":"integer"},"max_tokens":{"type":"integer"},"messages":{"items":{"type":"object"},"type":"array"},"model":{"description":"Our products (james, elliot, taylor, james-direct) or any market model id from GET /api/v1/broker/models (vendor/model) — served by the cheapest eligible provider.","example":"deepseek/deepseek-v4.1-flash","type":"string"},"presence_penalty":{"type":"number"},"response_format":{"description":"{\"type\": \"json_object\"} or {\"type\": \"json_schema\", \"json_schema\": …}","type":"object"},"routing":{"$ref":"#/components/schemas/BrokerRouting"},"seed":{"type":"integer"},"stop":{"oneOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}]},"stream":{"default":false,"type":"boolean"},"temperature":{"type":"number"},"tool_choice":{"oneOf":[{"enum":["auto","none","required"],"type":"string"},{"type":"object"}]},"tools":{"items":{"type":"object"},"type":"array"},"top_p":{"type":"number"}},"required":["model","messages"],"title":"ChatCompletionRequest","type":"object"},"RefreshRequest":{"properties":{"refresh_token":{"type":"string"}},"required":["refresh_token"],"title":"RefreshRequest","type":"object"},"BrokerMarketModels":{"properties":{"categories":{"items":{"type":"string"},"type":"array"},"data":{"items":{"$ref":"#/components/schemas/BrokerMarketModel"},"type":"array"},"object":{"example":"list","type":"string"}},"required":["data"],"title":"BrokerMarketModels","type":"object"},"SendMessageRequest":{"properties":{"content":{"description":"Alternative field for message text","type":"string"},"conversationId":{"description":"Existing conversation ID","type":"string"},"message":{"description":"Alternative field for message text","type":"string"},"model":{"description":"Override LLM model","type":"string"},"title":{"description":"Title for a new conversation","type":"string"},"userMessage":{"description":"The user message text","type":"string"}},"title":"SendMessageRequest","type":"object"},"BrokerMarketModel":{"properties":{"capabilities":{"description":"Supported by at least one provider","items":{"type":"string"},"type":"array"},"context":{"description":"Largest context window (tokens)","nullable":true,"type":"integer"},"id":{"description":"Use as model on chat/completions (type chat), images/generations (image), audio/speech (speech) or audio/transcriptions (transcription), videos (video)","type":"string"},"name":{"type":"string"},"own":{"description":"Media rows: our own product (iris, quill)","type":"boolean"},"price":{"description":"Cheapest customer price. Chat: input/output per 1M tokens. Media: exactly one of per_image, per_1k_characters, per_minute, per_second (video, default resolution; billed: actual cost)","properties":{"currency":{"type":"string"},"input":{"type":"string"},"output":{"type":"string"},"per":{"type":"string"},"per_1k_characters":{"type":"string"},"per_image":{"type":"string"},"per_minute":{"type":"string"},"per_second":{"type":"string"}},"type":"object"},"providers":{"type":"integer"},"regions":{"items":{"type":"string"},"type":"array"},"scores":{"additionalProperties":{"type":"number"},"description":"Our own measurement per category, 0..1 (absent = not measured)","type":"object"},"throughput":{"description":"tokens/s (best provider)","nullable":true,"type":"number"},"type":{"description":"Only on media rows (`?type=`); chat rows omit it","enum":["image","speech","transcription","video"],"type":"string"},"vendor":{"type":"string"}},"required":["id","price","regions","providers"],"title":"BrokerMarketModel","type":"object"},"A2AJsonRpcResponse":{"properties":{"error":{"properties":{"code":{"description":"JSON-RPC error code","type":"integer"},"message":{"type":"string"}},"type":"object"},"id":{"oneOf":[{"type":"integer"},{"type":"string"}]},"jsonrpc":{"enum":["2.0"],"type":"string"},"result":{"description":"Success result","type":"object"}},"required":["jsonrpc"],"title":"A2AJsonRpcResponse","type":"object"},"ConversationList":{"properties":{"balanceCredits":{"description":"User wallet balance","type":"string"},"items":{"items":{"$ref":"#/components/schemas/Conversation"},"type":"array"},"nextCursor":{"nullable":true,"type":"string"}},"title":"ConversationList","type":"object"},"BrokerError":{"properties":{"error":{"properties":{"code":{"example":"invalid_request","type":"string"},"message":{"type":"string"},"param":{"description":"The offending field, if any","nullable":true,"type":"string"},"request_id":{"description":"Quote it when contacting support","nullable":true,"type":"string"},"type":{"description":"invalid_request_error | authentication_error | rate_limit_error | server_error …","example":"invalid_request_error","type":"string"}},"required":["message","type","code"],"type":"object"}},"required":["error"],"title":"BrokerError","type":"object"},"BrokerAccountKey":{"properties":{"api_key":{"description":"ast_sk_… — shown exactly once. Use with base_url and model taylor (OpenAI-compatible).","type":"string"},"base_url":{"format":"uri","type":"string"},"billing":{"enum":["topup","monthly"],"type":"string"},"category":{"description":"null = no default level","nullable":true,"type":"string"},"level":{"description":"null = no default level","nullable":true,"type":"string"},"model":{"example":"taylor","type":"string"},"note":{"type":"string"}},"required":["api_key","base_url","model"],"title":"BrokerAccountKey","type":"object"},"RefreshResponse":{"properties":{"access_token":{"type":"string"}},"title":"RefreshResponse","type":"object"},"BrokerCreateAccountRequest":{"example":{"amount":25,"billing":"topup","category":"coding","level":"strong"},"properties":{"accept_terms":{"description":"Required with shared_payment_token: you accept https://llm-broker.net/terms.","type":"boolean"},"amount":{"description":"Top-up in `currency` (default CHF) — required when billing=topup. Credited in CHF at the ECB daily rate of the checkout.","enum":[10,25,50],"type":"integer"},"billing":{"description":"topup = prepaid credit (requires amount), monthly = monthly invoice (requires limit). Omit billing entirely for a topup of the smallest amount of the currency.","enum":["topup","monthly"],"type":"string"},"category":{"description":"Optional default of the key (with level). Omit both to choose per request with routing.","enum":["coding","reasoning","math","instruction_following"],"type":"string"},"currency":{"default":"USD","description":"Payment currency (default USD). The card is charged in it; your balance is kept in CHF (ECB daily rate).","enum":["USD","EUR","CHF","GBP","JPY","CNY","AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BIF","BMD","BND","BOB","BRL","BSD","BWP","BYN","BZD","CAD","CDF","CLP","COP","CRC","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ETB","FJD","FKP","GEL","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","ISK","JMD","KES","KGS","KHR","KMF","KRW","KYD","KZT","LAK","LBP","LKR","LRD","LSL","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SEK","SGD","SHP","SLE","SOS","SRD","SZL","THB","TJS","TOP","TRY","TTD","TWD","TZS","UAH","UGX","UYU","UZS","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW"],"type":"string"},"email":{"description":"Required with shared_payment_token: the responsible person or company.","format":"email","type":"string"},"level":{"description":"Optional default level of the key (with category); every request can override it with routing.level or routing.min_score. Only one of category/level ⇒ 400.","enum":["solid","strong","top","best"],"type":"string"},"limit":{"description":"Monthly limit in `currency` (default CHF) — required when billing=monthly.","enum":[50,100,250],"type":"integer"},"shared_payment_token":{"description":"Stripe Shared Payment Token (spt_…) issued to LLM Broker by your agent platform: pays the topup without a browser and returns the key immediately (201). Needs accept_terms and email. Topup only; one token pays once; at most 3 accounts per card per day.","type":"string"}},"title":"BrokerCreateAccountRequest","type":"object"},"WalletHistoryResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WalletTransaction"},"type":"array"},"nextCursor":{"nullable":true,"type":"string"}},"title":"WalletHistoryResponse","type":"object"},"BrokerCardSetup":{"properties":{"session_id":{"type":"string"},"setup_url":{"format":"uri","type":"string"}},"required":["setup_url"],"title":"BrokerCardSetup","type":"object"},"CreateApiKeyRequest":{"properties":{"name":{"description":"Key name (default: 'API Key')","type":"string"},"scopes":{"description":"Optional scope restrictions","items":{"type":"string"},"nullable":true,"type":"array"}},"title":"CreateApiKeyRequest","type":"object"},"RagIngestRequest":{"properties":{"items":{"description":"Documents to ingest","items":{"type":"object"},"type":"array"}},"required":["items"],"title":"RagIngestRequest","type":"object"},"WalletResponse":{"properties":{"balanceCredits":{"description":"Current credit balance","type":"string"},"pendingPurchases":{"items":{"type":"object"},"type":"array"}},"title":"WalletResponse","type":"object"},"BrokerRecommendation":{"properties":{"alternatives":{"items":{"type":"object"},"type":"array"},"basis":{"type":"string"},"best":{"description":"Highest measured score in the category","type":"object"},"best_value":{"description":"Highest score per output price","type":"object"},"category":{"type":"string"},"chat_arguments":{"description":"Use as-is in POST /api/v1/chat/completions","type":"object"},"currency":{"type":"string"},"routing":{"description":"Let the broker pick per request with these limits","type":"object"}},"required":["category","best","best_value","routing"],"title":"BrokerRecommendation","type":"object"},"ErrorResponse":{"properties":{"details":{"description":"Additional error context","nullable":true,"type":"object"},"error":{"description":"Machine-readable error code","type":"string"},"message":{"description":"Human-readable error message","type":"string"}},"required":["error"],"title":"ErrorResponse","type":"object"},"BrokerCreateAccountResponse":{"properties":{"checkout_url":{"description":"Stripe checkout (card only) — a human or an agent with a browser enters the card.","format":"uri","type":"string"},"note":{"type":"string"},"session_id":{"description":"Secret — whoever knows it collects the key. Do not log.","type":"string"},"status_url":{"format":"uri","type":"string"}},"required":["checkout_url","session_id","status_url"],"title":"BrokerCreateAccountResponse","type":"object"},"MessageList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array"},"nextCursor":{"nullable":true,"type":"string"}},"title":"MessageList","type":"object"},"BrokerUpdateBillingRequest":{"properties":{"amount":{"enum":[10,25,50],"type":"integer"},"billing":{"enum":["topup","monthly"],"type":"string"},"limit":{"enum":[50,100,250],"type":"integer"}},"required":["billing"],"title":"BrokerUpdateBillingRequest","type":"object"}},"securitySchemes":{"apiKeyAuth":{"description":"API key as Bearer token: customer keys `ast_sk_…` (account page or POST /api/v1/broker/accounts); internal/CLI keys `acore_…` (legacy `mgpt_…` still accepted)","in":"header","name":"Authorization","type":"apiKey"},"bearerAuth":{"bearerFormat":"JWT","description":"JWT access token obtained via POST /auth/login","scheme":"bearer","type":"http"}}},"info":{"description":"REST API for AstrionCore — AI Operating System. Covers chat, authentication, wallet, media, RAG, and user management.","title":"AstrionCore Core API","version":"1.0.0"},"openapi":"3.0.0","paths":{"/api/v1/broker/billing":{"get":{"callbacks":{},"description":"Balance, monthly spend, card, top-up rule. With the ast_sk_ key of the broker account.","operationId":"AstrionWeb.BrokerApiController.billing","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerBillingStatus"}}},"description":"Status"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Not a broker key"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Not a broker account"}},"security":[{"apiKeyAuth":[]}],"summary":"Billing status","tags":["Account & payment"]},"patch":{"callbacks":{},"description":"topup with amount 10/25/50 or monthly with limit 50/100/250. Requires a card on file. monthly → topup needs a settled balance; one monthly credit limit per card.","operationId":"AstrionWeb.BrokerApiController.update_billing","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerUpdateBillingRequest"}}},"description":"New choice","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerBillingStatus"}}},"description":"New status"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Invalid choice"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"No card, outstanding balance, or card limit taken"}},"security":[{"apiKeyAuth":[]}],"summary":"Change billing mode or amount","tags":["Account & payment"]}},"/healthz/ready":{"get":{"callbacks":{},"operationId":"AstrionWeb.PublicController.health_ready","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}},"description":"Ready"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}},"description":"Not ready"}},"summary":"Readiness probe","tags":["Health"]}},"/.well-known/agent-card.json":{"get":{"callbacks":{},"description":"Returns the A2A Agent Card describing this agent's capabilities","operationId":"AstrionWeb.A2AController.agent_card","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2AAgentCard"}}},"description":"Agent Card"}},"summary":"A2A Agent Card Discovery","tags":[]}},"/api-info":{"get":{"callbacks":{},"description":"Returns basic API status and version information.","operationId":"AstrionWeb.PublicController.root","parameters":[],"responses":{"200":{"content":{"application/json":{}},"description":"API info"}},"summary":"API information","tags":["Health"]}},"/memory":{"get":{"callbacks":{},"operationId":"AstrionWeb.MemoryController.list","parameters":[],"responses":{"200":{"content":{"application/json":{}},"description":"Memory list"}},"security":[{"bearerAuth":[]}],"summary":"List memory entries","tags":["Memory"]},"post":{"callbacks":{},"operationId":"AstrionWeb.MemoryController.create","parameters":[],"responses":{"200":{"content":{"application/json":{}},"description":"Created"}},"security":[{"bearerAuth":[]}],"summary":"Create a memory entry","tags":["Memory"]}},"/api/v1/broker/currencies":{"get":{"callbacks":{},"description":"Every currency Stripe accepts for us that has a fresh daily rate, with the allowed top-up amounts and monthly limits in that currency (whole units). Rates: ECB euro reference rates; other currencies ExchangeRate-API (https://www.exchangerate-api.com). Internal ledger stays in CHF. No key needed.","operationId":"AstrionWeb.BrokerApiController.currencies","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Currencies"}},"security":[],"summary":"Currencies you can see prices in and pay with","tags":["Account & payment","Account & payment"]}},"/media/upload":{"post":{"callbacks":{},"description":"Upload an image or file to the user's gallery.","operationId":"AstrionWeb.MediaController.upload","parameters":[],"requestBody":{"content":{"multipart/form-data":{}},"description":"Multipart file upload","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUploadResponse"}}},"description":"Upload result"}},"security":[{"bearerAuth":[]}],"summary":"Upload a media file","tags":["Media"]}},"/media/{id}":{"delete":{"callbacks":{},"operationId":"AstrionWeb.MediaController.delete (2)","parameters":[{"description":"Photo ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{}},"description":"Deleted"},"404":{"description":"Not found"}},"security":[{"bearerAuth":[]}],"summary":"Delete a media file","tags":["Media"]}},"/rag/search":{"get":{"callbacks":{},"operationId":"AstrionWeb.RagController.search","parameters":[{"description":"Search query","in":"query","name":"q","required":true,"schema":{"type":"string"}},{"description":"Language filter","in":"query","name":"lang","required":false,"schema":{"type":"string"}},{"description":"Source type filter","in":"query","name":"source_type","required":false,"schema":{"type":"string"}},{"description":"Max results","in":"query","name":"top_k","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RagSearchResponse"}}},"description":"Search results"}},"security":[{"bearerAuth":[]}],"summary":"Search RAG knowledge base","tags":["RAG"]}},"/api-keys/{id}":{"delete":{"callbacks":{},"operationId":"AstrionWeb.ApiKeyController.delete","parameters":[{"description":"API key ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Not found"}},"security":[{"bearerAuth":[]}],"summary":"Delete an API key","tags":["API Keys"]}},"/rag/ingest":{"post":{"callbacks":{},"description":"Ingest a list of documents for later retrieval-augmented generation.","operationId":"AstrionWeb.RagController.ingest","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RagIngestRequest"}}},"description":"Ingest payload","required":false},"responses":{"200":{"content":{"application/json":{}},"description":"Ingested"}},"security":[{"bearerAuth":[]}],"summary":"Ingest documents into RAG","tags":["RAG"]}},"/api/v1/models":{"get":{"callbacks":{},"deprecated":false,"description":"Our products and the market models the broker can route to. Use the `id` as `model` in chat/completions.","operationId":"listModels","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Model list"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Missing or invalid API key"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Insufficient balance"}},"security":[{"apiKeyAuth":[]}],"summary":"List models (OpenAI-compatible)","tags":["OpenAI-compatible"]}},"/chat/send":{"post":{"callbacks":{},"description":"Send a message and receive an AI reply via the pipeline.","operationId":"AstrionWeb.ChatController.send_message","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}},"description":"Message payload","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}},"description":"Chat reply"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Payment required"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Backend error"}},"security":[{"bearerAuth":[]}],"summary":"Send a chat message","tags":["Chat"]}},"/media/{id}/delete":{"post":{"callbacks":{},"operationId":"AstrionWeb.MediaController.delete","parameters":[{"description":"Photo ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{}},"description":"Deleted"},"404":{"description":"Not found"}},"security":[{"bearerAuth":[]}],"summary":"Delete a media file","tags":["Media"]}},"/a2a":{"post":{"callbacks":{},"description":"Accepts JSON-RPC 2.0 requests for A2A protocol methods (message/send, message/stream, tasks/get, tasks/cancel, tasks/resubscribe)","operationId":"AstrionWeb.A2AController.rpc","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2AJsonRpcRequest"}}},"description":"JSON-RPC Request","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2AJsonRpcResponse"}}},"description":"JSON-RPC Response"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2AJsonRpcResponse"}}},"description":"Invalid Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2AJsonRpcResponse"}}},"description":"Unauthorized"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/A2AJsonRpcResponse"}}},"description":"Rate Limited"}},"security":[{"bearerAuth":[]}],"summary":"A2A JSON-RPC Endpoint","tags":[]}},"/api/v1/broker/recommend":{"get":{"callbacks":{},"description":"Picks from the published catalog — our own benchmark scores and list prices: best = highest score in the category, best_value = score per output price, plus alternatives and a ready `routing` object for POST /api/v1/chat/completions. Only measured models are recommended. No key needed.","operationId":"AstrionWeb.BrokerApiController.recommend","parameters":[{"description":"coding, reasoning, math, …","in":"query","name":"category","required":true,"schema":{"type":"string"}},{"description":"Max output price per 1M tokens, in currency","in":"query","name":"max_price_per_mtok","required":false,"schema":{"type":"number"}},{"description":"0..1","in":"query","name":"min_score","required":false,"schema":{"type":"number"}},{"description":"ch, eu, us, asia, global","in":"query","name":"region","required":false,"schema":{"type":"string"}},{"description":"Comma-separated, e.g. tools,vision","in":"query","name":"capabilities","required":false,"schema":{"type":"string"}},{"description":"ISO 4217, default USD","in":"query","name":"currency","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerRecommendation"}}},"description":"Recommendation"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Unknown category"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"No measured model within these limits"}},"security":[],"summary":"Recommend a model for a task (free, no key)","tags":["Account & payment","Routing"]}},"/me":{"delete":{"callbacks":{},"operationId":"AstrionWeb.UserController.delete_me","parameters":[],"responses":{"204":{"description":"Account deleted"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"}},"security":[{"bearerAuth":[]}],"summary":"Delete current user account","tags":["User"]},"get":{"callbacks":{},"operationId":"AstrionWeb.UserController.me","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}},"description":"User profile"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"Get current user profile","tags":["User"]},"patch":{"callbacks":{},"description":"Update allowed fields: display_name, avatar_url, locale, timezone, bio.","operationId":"AstrionWeb.UserController.update_me","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUserRequest"}}},"description":"Profile updates","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}},"description":"Updated profile"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"}},"security":[{"bearerAuth":[]}],"summary":"Update current user profile","tags":["User"]}},"/wallet/topup":{"post":{"callbacks":{},"operationId":"AstrionWeb.WalletController.topup","parameters":[],"responses":{"200":{"content":{"application/json":{}},"description":"Success"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"Top up wallet","tags":["Wallet"]}},"/auth/register":{"post":{"callbacks":{},"description":"Create a new account. Returns JWT tokens on success or pending approval status.","operationId":"AstrionWeb.AuthController.register","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"description":"Registration payload","required":false},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}},"description":"User created"},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Pending approval"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"User exists"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Validation errors"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Rate limited"}},"summary":"Register a new user","tags":["Auth"]}},"/api/v1/broker/models":{"get":{"callbacks":{},"description":"Every model you can name in `model` on POST /api/v1/chat/completions, served by the cheapest eligible provider without harness. Price = customer price in CHF per 1M tokens (incl. our margin); scores = our own measurements per category (0..1, only where measured) — the basis for `routing.min_score`. No key needed.","operationId":"AstrionWeb.BrokerApiController.models","parameters":[{"description":"Price currency (ISO 4217, default USD): any code from GET /api/v1/broker/currencies — converted at the daily rate (ECB, else ExchangeRate-API); internal ledger stays in CHF","in":"query","name":"currency","required":false,"schema":{"type":"string"}},{"description":"Model type: chat (default, LLM), image (POST /api/v1/images/generations), speech (POST /api/v1/audio/speech), transcription (POST /api/v1/audio/transcriptions), video (POST /api/v1/videos). Media rows carry exactly one price: per_image, per_1k_characters, per_minute or per_second; own products have own: true","in":"query","name":"type","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerMarketModels"}}},"description":"Market models"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Unknown currency or type"}},"security":[],"summary":"Market models (for model and routing)","tags":["Account & payment","Routing"]}},"/chat/send/stream":{"post":{"callbacks":{},"description":"Send a message and receive a streaming SSE response with delta chunks.","operationId":"AstrionWeb.ChatController.send_message_stream","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}},"description":"Message payload","required":false},"responses":{"200":{"content":{"text/event-stream":{}},"description":"SSE event stream"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Payment required"}},"security":[{"bearerAuth":[]}],"summary":"Send a chat message (streaming)","tags":["Chat"]}},"/api/chat/{id}/messages":{"get":{"callbacks":{},"description":"Returns messages with cursor-based pagination.","operationId":"AstrionWeb.ChatController.get_messages (2)","parameters":[{"description":"Conversation ID","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Max results (1-100, default 30)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"ISO 8601 cursor","in":"query","name":"cursor","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageList"}}},"description":"Message list"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"Get messages for a conversation","tags":["Chat"]}},"/api/v1/images/generations":{"post":{"callbacks":{},"deprecated":false,"description":"Returns `data[].b64_json`. Charged per image after delivery.","operationId":"createImage","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"n":{"minimum":1,"type":"integer"},"prompt":{"type":"string"},"response_format":{"enum":["b64_json"],"type":"string"},"size":{"example":"1024x1024","type":"string"}},"required":["prompt"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Images"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Missing or invalid API key"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Insufficient balance"}},"security":[{"apiKeyAuth":[]}],"summary":"Generate images (OpenAI-compatible)","tags":["OpenAI-compatible"]}},"/chat/create":{"post":{"callbacks":{},"operationId":"AstrionWeb.ChatController.create_conversation","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationRequest"}}},"description":"Conversation params","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}},"description":"Created conversation"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"Create a new conversation","tags":["Chat"]}},"/chat/last":{"get":{"callbacks":{},"operationId":"AstrionWeb.ChatController.last_conversation","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversation"}}},"description":"Last conversation"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"Get the most recent conversation","tags":["Chat"]}},"/api/v1/broker/card":{"delete":{"callbacks":{},"operationId":"AstrionWeb.BrokerApiController.card_delete","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerBillingStatus"}}},"description":"New status"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Not a broker key"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Outstanding balance"}},"security":[{"apiKeyAuth":[]}],"summary":"Remove card","tags":["Account & payment"]},"post":{"callbacks":{},"description":"Returns a Stripe setup link; only Stripe sees the card number.","operationId":"AstrionWeb.BrokerApiController.card_create","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerCardSetup"}}},"description":"Setup link"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Not a broker key"}},"security":[{"apiKeyAuth":[]}],"summary":"Add or replace card","tags":["Account & payment"]}},"/healthz":{"get":{"callbacks":{},"description":"Kubernetes liveness probe endpoint.","operationId":"AstrionWeb.PublicController.health","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}},"description":"Healthy"}},"summary":"Health check","tags":["Health"]}},"/api/v1/audio/speech":{"post":{"callbacks":{},"deprecated":false,"description":"Streams audio. Unknown `voice` answers 400 `unknown_voice` with the list of voices.","operationId":"createSpeech","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"type":"string"},"language":{"type":"string"},"response_format":{"default":"mp3","enum":["mp3","opus","aac","flac","wav","pcm"],"type":"string"},"voice":{"type":"string"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"audio/mpeg":{"schema":{"format":"binary","type":"string"}}},"description":"Audio (mp3 by default; wav/pcm stream)"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Missing or invalid API key"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Insufficient balance"}},"security":[{"apiKeyAuth":[]}],"summary":"Text to speech (OpenAI-compatible)","tags":["OpenAI-compatible"]}},"/api/v1/chat/completions":{"post":{"callbacks":{},"description":"model = our product or any market model id (GET /api/v1/broker/models): the cheapest eligible provider serves it. routing narrows by exact min_score per category, sort (price|value|speed|score), region and max_price. Errors: 400 invalid_routing, 402 insufficient_balance, 409 no_matching_offer.","operationId":"AstrionWeb.OpenAICompatController.chat_completions","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}},"description":"Request","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Completion (or SSE stream with stream=true)"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Invalid request or routing"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Insufficient balance"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"No offer matches the routing"}},"summary":"Chat completion (OpenAI-compatible) with model choice and routing","tags":["Routing"]}},"/media/photo/{id}/download":{"get":{"callbacks":{},"operationId":"AstrionWeb.MediaController.download (2)","parameters":[{"description":"Photo ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/octet-stream":{}},"description":"File content"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"404":{"description":"Not found"}},"security":[{"bearerAuth":[]}],"summary":"Download a media file","tags":["Media"]}},"/api/v1/audio/transcriptions":{"post":{"callbacks":{},"deprecated":false,"description":"multipart/form-data with `file`. `response_format=text` returns plain text, otherwise `{text, language, duration, model}`.","operationId":"createTranscription","parameters":[],"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"},"language":{"type":"string"},"response_format":{"enum":["json","text"],"type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Transcript"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Missing or invalid API key"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Insufficient balance"}},"security":[{"apiKeyAuth":[]}],"summary":"Speech to text (OpenAI-compatible)","tags":["OpenAI-compatible"]}},"/api/v1/broker/accounts":{"post":{"callbacks":{},"description":"Creates a Stripe checkout (card only). Enter the card, then poll status_url: the key appears exactly once. No free credit — money before key. 10 purchases per IP and hour. Same API on llm-broker.net and astrioncore.app. Agents with a Stripe Shared Payment Token pass `shared_payment_token` (+ accept_terms, email) and get the key in the 201 response — no browser.","operationId":"AstrionWeb.BrokerApiController.create_account","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerCreateAccountRequest"}}},"description":"Purchase choice","required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerCreateAccountResponse"}}},"description":"Checkout created — or, with shared_payment_token, the paid key (api_key, shown once)"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Invalid choice, level, token or missing terms"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Shared payment token unusable or payment failed"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Level not available today, or token already used"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Rate limited, or card limit (payment refunded)"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Payment provider unavailable"}},"security":[],"summary":"Buy an account via API (no login)","tags":["Account & payment"]}},"/api/v1/broker/accounts/{session_id}":{"get":{"callbacks":{},"description":"202 while payment is open, 200 with the key exactly once, then 410.","operationId":"AstrionWeb.BrokerApiController.account","parameters":[{"description":"from POST /api/v1/broker/accounts","in":"path","name":"session_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerAccountKey"}}},"description":"Key (exactly once)"},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerAccountPending"}}},"description":"Payment pending"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Unknown session"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Already collected"}},"security":[],"summary":"Poll purchase status / collect the key","tags":["Account & payment"]}},"/wallet/history":{"get":{"callbacks":{},"operationId":"AstrionWeb.WalletController.history","parameters":[{"description":"Max results (default 50, max 200)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"Pagination cursor","in":"query","name":"cursor","required":false,"schema":{"type":"string"}},{"description":"Filter by transaction type","in":"query","name":"type","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletHistoryResponse"}}},"description":"Transaction history"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"Get wallet transaction history","tags":["Wallet"]}},"/media/{id}/analyze":{"post":{"callbacks":{},"operationId":"AstrionWeb.MediaController.analyze","parameters":[{"description":"Photo ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{}},"description":"Analysis queued"},"404":{"description":"Not found"}},"security":[{"bearerAuth":[]}],"summary":"Analyze a media file with AI","tags":["Media"]}},"/media/photo/{id}/view":{"get":{"callbacks":{},"operationId":"AstrionWeb.MediaController.download","parameters":[{"description":"Photo ID","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/octet-stream":{}},"description":"File content"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"404":{"description":"Not found"}},"security":[{"bearerAuth":[]}],"summary":"Download a media file","tags":["Media"]}},"/auth/refresh":{"post":{"callbacks":{},"description":"Exchange a valid refresh token for a new access token.","operationId":"AstrionWeb.AuthController.refresh","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"description":"Refresh payload","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshResponse"}}},"description":"New access token"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid refresh token"}},"summary":"Refresh access token","tags":["Auth"]}},"/memory/{id}":{"delete":{"callbacks":{},"operationId":"AstrionWeb.MemoryController.delete","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{}},"description":"Deleted"}},"security":[{"bearerAuth":[]}],"summary":"Delete a memory entry","tags":["Memory"]},"get":{"callbacks":{},"operationId":"AstrionWeb.MemoryController.get","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{}},"description":"Memory entry"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"Get a memory entry","tags":["Memory"]},"patch":{"callbacks":{},"operationId":"AstrionWeb.MemoryController.update","parameters":[{"description":"","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{}},"description":"Updated"}},"security":[{"bearerAuth":[]}],"summary":"Update a memory entry","tags":["Memory"]}},"/api/v1/embeddings":{"post":{"callbacks":{},"deprecated":false,"description":"`input` is a string or an array of strings; returns `data[].embedding`.","operationId":"createEmbedding","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"oneOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"}]},"model":{"type":"string"}},"required":["input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"Embeddings"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Invalid request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Missing or invalid API key"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrokerError"}}},"description":"Insufficient balance"}},"security":[{"apiKeyAuth":[]}],"summary":"Embeddings (OpenAI-compatible)","tags":["OpenAI-compatible"]}},"/healthz/live":{"get":{"callbacks":{},"operationId":"AstrionWeb.PublicController.health_live","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}},"description":"Alive"}},"summary":"Liveness probe","tags":["Health"]}},"/api-keys":{"get":{"callbacks":{},"description":"Returns all API keys for the current user.","operationId":"AstrionWeb.ApiKeyController.list","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyListResponse"}}},"description":"API key list"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"List API keys","tags":["API Keys"]},"post":{"callbacks":{},"operationId":"AstrionWeb.ApiKeyController.create","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}},"description":"Key params","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyItem"}}},"description":"Created key (includes plainKey)"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad request"}},"security":[{"bearerAuth":[]}],"summary":"Create a new API key","tags":["API Keys"]}},"/auth/login":{"post":{"callbacks":{},"description":"Authenticate with email and password. Returns JWT access and refresh tokens.","operationId":"AstrionWeb.AuthController.login","parameters":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"description":"Login payload","required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}},"description":"Login successful"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid credentials"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Account banned or pending"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too many attempts"}},"summary":"Log in","tags":["Auth"]}},"/wallet":{"get":{"callbacks":{},"operationId":"AstrionWeb.WalletController.get_wallet","parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletResponse"}}},"description":"Wallet balance"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"Get wallet balance","tags":["Wallet"]}},"/chat/{id}/messages":{"get":{"callbacks":{},"description":"Returns messages with cursor-based pagination.","operationId":"AstrionWeb.ChatController.get_messages","parameters":[{"description":"Conversation ID","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"Max results (1-100, default 30)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"ISO 8601 cursor","in":"query","name":"cursor","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageList"}}},"description":"Message list"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"Get messages for a conversation","tags":["Chat"]}},"/media/list":{"get":{"callbacks":{},"description":"Returns all photos and galleries for the current user.","operationId":"AstrionWeb.MediaController.list","parameters":[],"responses":{"200":{"content":{"application/json":{}},"description":"Media list"}},"security":[{"bearerAuth":[]}],"summary":"List media files","tags":["Media"]}},"/chat/list":{"get":{"callbacks":{},"description":"Returns conversations ordered by updated_at with cursor-based pagination.","operationId":"AstrionWeb.ChatController.list_conversations_cursor","parameters":[{"description":"Max results (1-100, default 50)","in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"description":"ISO 8601 cursor from previous response","in":"query","name":"cursor","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationList"}}},"description":"Conversation list"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"List conversations (cursor-paginated)","tags":["Chat"]}}},"security":[],"servers":[{"url":"/","variables":{}}],"tags":[]}