{"openapi":"3.0.0","paths":{"/v1/ai/prices":{"get":{"operationId":"PricesController_getPrices","parameters":[{"name":"x-api-key","in":"header","description":"API public key (pk_dev_... or pk_live_...). Alternatively, pass sk_... in the Authorization: Bearer header.","required":false,"schema":{"type":"string"}},{"name":"tokens","required":false,"in":"query","description":"Filter by symbol (ETH,BTC,STRK)","schema":{"type":"string"}},{"name":"chain","required":false,"in":"query","description":"Filter by chain: ethereum, starknet, base, arbitrum, optimism, polygon, solana, bnb, avalanche, sui, ton","schema":{"type":"string"}},{"name":"category","required":false,"in":"query","description":"Filter by category (core, stablecoin, defi, btc-variant, yield, meme, rwa, l1, l2, governance)","schema":{"type":"string"}},{"name":"fiat","required":false,"in":"query","description":"Include fiat rates (MXN,COP,BRL or 'all' for 60 currencies)","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Get token prices + optional fiat rates (free, ~90 tokens, 60 currencies, 30s refresh)","tags":["AI API"]}},"/v1/ai/prices/chains":{"get":{"operationId":"PricesController_getChains","parameters":[{"name":"x-api-key","in":"header","description":"API public key (pk_dev_... or pk_live_...). Alternatively, pass sk_... in the Authorization: Bearer header.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":""}},"summary":"List supported chains with token counts","tags":["AI API"]}},"/v1/ai/prices/currencies":{"get":{"operationId":"PricesController_getCurrencies","parameters":[{"name":"x-api-key","in":"header","description":"API public key (pk_dev_... or pk_live_...). Alternatively, pass sk_... in the Authorization: Bearer header.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":""}},"summary":"List supported fiat currencies","tags":["AI API"]}},"/v1/ai/signals":{"get":{"operationId":"PricesController_getSignals","parameters":[{"name":"x-api-key","in":"header","description":"API public key (pk_dev_... or pk_live_...). Alternatively, pass sk_... in the Authorization: Bearer header.","required":false,"schema":{"type":"string"}},{"name":"tokens","required":false,"in":"query","description":"Filter by symbol (ETH,BTC,STRK)","schema":{"type":"string"}},{"name":"chain","required":false,"in":"query","description":"Filter yields by chain","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}},"summary":"Technical signals + market sentiment + DeFi yields (paid, $0.0005/call)","tags":["AI API"]}},"/v1/ai/chat":{"post":{"operationId":"AiController_chat","parameters":[{"name":"x-api-key","in":"header","description":"API key (pk_ or sk_). No JWKS required.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatDto"}}}},"responses":{"201":{"description":"AI response with token usage and cost","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponseDto"}}}},"400":{"description":"Invalid model or missing messages"},"402":{"description":"Insufficient credit balance"}},"summary":"General-purpose AI chat (paid per token)","tags":["AI API"]}},"/v1/ai/think":{"post":{"operationId":"AiController_think","parameters":[{"name":"x-api-key","in":"header","description":"API key (pk_ or sk_). No JWKS required.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThinkDto"}}}},"responses":{"201":{"description":"Structured JSON decision with risk parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThinkResponseDto"}}}},"400":{"description":"Missing portfolio or invalid model"},"402":{"description":"Insufficient credit balance"}},"summary":"DeFi AI decision engine (paid per token)","tags":["AI API"]}},"/v1/ai/models":{"get":{"operationId":"AiController_getModels","parameters":[{"name":"x-api-key","in":"header","description":"API key (pk_ or sk_). No JWKS required.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsResponseDto"}}}}},"summary":"List available AI models with pricing and limits","tags":["AI API"]}},"/v1/ai/execute":{"post":{"operationId":"AiController_execute","parameters":[{"name":"x-api-key","in":"header","description":"API key (pk_ or sk_). No JWKS required.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteDto"}}}},"responses":{"201":{"description":"Unsigned swap calls from AVNU","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteResponseDto"}}}},"400":{"description":"Invalid chain, action, token, or amount"},"402":{"description":"Insufficient credit balance"}},"summary":"Build swap transaction calldata (paid, $0.002/call)","tags":["AI API"]}},"/v1/ai/chat/stream":{"post":{"operationId":"AiController_chatStream","parameters":[{"name":"x-api-key","in":"header","description":"API key (pk_ or sk_). No JWKS required.","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatDto"}}}},"responses":{"201":{"description":""}},"summary":"Streaming AI chat — Server-Sent Events (paid per token)","tags":["AI API"]}}},"info":{"title":"Chipi AI API","description":"Crypto-native AI gateway. 8 models, 90 tokens, 60 fiat currencies, 11 chains. Auth: sk_ in Authorization Bearer OR pk_ in x-api-key. No JWKS for AI endpoints. Docs: https://docs.chipipay.com","version":"1.0.0","contact":{}},"tags":[{"name":"AI API","description":"AI chat, think, signals, execute, prices — crypto-native billing"}],"servers":[{"url":"https://api.chipipay.com","description":"Production"}],"components":{"securitySchemes":{"pk-key":{"type":"apiKey","in":"header","name":"x-api-key","description":"Public API key (pk_dev_... or pk_prod_...)"},"sk-key":{"scheme":"bearer","bearerFormat":"JWT","type":"http","description":"Secret API key (sk_dev_... or sk_prod_...)"}},"schemas":{"ChatDto":{"type":"object","properties":{}},"ChatResponseDto":{"type":"object","properties":{"text":{"type":"string","example":"Starknet is a Layer 2 scaling solution for Ethereum that uses zero-knowledge proofs."},"model":{"type":"string","example":"haiku","description":"Model used for this request"},"provider":{"type":"string","example":"anthropic","enum":["anthropic","openai","google"]},"usage":{"$ref":"#/components/schemas/ChatUsageDto"},"cost":{"$ref":"#/components/schemas/CostDto"},"finishReason":{"type":"string","example":"stop","description":"Why generation stopped"},"latencyMs":{"type":"number","example":646,"description":"End-to-end latency in milliseconds"}},"required":["text","model","provider","usage","cost","finishReason","latencyMs"]},"ThinkDto":{"type":"object","properties":{}},"ThinkResponseDto":{"type":"object","properties":{"decision":{"$ref":"#/components/schemas/ThinkDecisionDto"},"riskParams":{"description":"Applied risk parameters (with defaults)","allOf":[{"$ref":"#/components/schemas/RiskParamsDto"}]},"model":{"type":"string","example":"haiku"},"provider":{"type":"string","example":"anthropic"},"usage":{"$ref":"#/components/schemas/ChatUsageDto"},"cost":{"$ref":"#/components/schemas/CostDto"},"latencyMs":{"type":"number","example":1507}},"required":["decision","riskParams","model","provider","usage","cost","latencyMs"]},"ModelsResponseDto":{"type":"object","properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/ModelDto"}},"default":{"type":"string","example":"haiku"}},"required":["models","default"]},"ExecuteDto":{"type":"object","properties":{}},"ExecuteResponseDto":{"type":"object","properties":{"calls":{"description":"Unsigned transaction calls (approve + swap)","type":"array","items":{"$ref":"#/components/schemas/SwapCallDto"}},"quote":{"$ref":"#/components/schemas/SwapQuoteDto"},"cost":{"$ref":"#/components/schemas/CostDto"}},"required":["calls","quote","cost"]}}}}