{"info":{"description":"Phase Router: OpenAI-compatible model router, about 400 models. Send a normal request (for example POST /v1/chat/completions with a model id from GET /v1/models, or model \"auto\") without Authorization: the 402 quotes the price of that request in USDT on Phase L1 (network eip155:1015, scheme upto, the ceiling is the price of the input plus max output tokens; you pay what the answer actually cost). Sign the authorization and repeat the request with the PAYMENT-SIGNATURE header. Many calls in a row: open a payment batch with POST /v1/batches. An API key (Authorization: Bearer phk_...) works instead of x402. Docs: /docs#x402, models and prices: /models, agents: /llms.txt.","title":"Phase Router","version":"1"},"openapi":"3.1.0","paths":{"/v1/audio/music":{"post":{"description":"Paid with x402 (x402Version 2, scheme upto, USDT on Phase L1, network eip155:1015) or an API key (Authorization: Bearer phk_...). A request without payment gets a 402 whose PAYMENT-REQUIRED header quotes its price; repeat it with the PAYMENT-SIGNATURE header. You pay what the answer actually cost.","operationId":"audio_music","requestBody":{"content":{"application/json":{"schema":{"properties":{"duration":{"description":"seconds","type":"integer"},"instrumental":{"type":"boolean"},"lyrics":{"description":"","type":"string"},"model":{"description":"model id from GET /v1/models (chat routes also take the classes auto, eco, premium, agentic)","type":"string"},"prompt":{"description":"style and mood","type":"string"}},"required":["model","prompt"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"audio","format":"binary","type":"string"}}},"description":"the answer"},"402":{"description":"payment required: the x402 quote (PAYMENT-REQUIRED header and JSON body)"}},"summary":"music generation (priced per second); the answer is the audio","x-payment-info":{"price":{"currency":"USD","mode":"dynamic"},"protocols":[{"x402":{}}]}}},"/v1/audio/speech":{"post":{"description":"Paid with x402 (x402Version 2, scheme upto, USDT on Phase L1, network eip155:1015) or an API key (Authorization: Bearer phk_...). A request without payment gets a 402 whose PAYMENT-REQUIRED header quotes its price; repeat it with the PAYMENT-SIGNATURE header. You pay what the answer actually cost.","operationId":"audio_speech","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"description":"the text","type":"string"},"model":{"description":"model id from GET /v1/models (chat routes also take the classes auto, eco, premium, agentic)","type":"string"},"response_format":{"description":"mp3 (default), wav, opus, flac or pcm","type":"string"},"voice":{"description":"","type":"string"}},"required":["model","input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"audio","format":"binary","type":"string"}}},"description":"the answer"},"402":{"description":"payment required: the x402 quote (PAYMENT-REQUIRED header and JSON body)"}},"summary":"text to speech (priced per character); the answer is the audio","x-payment-info":{"price":{"currency":"USD","mode":"dynamic"},"protocols":[{"x402":{}}]}}},"/v1/audio/transcriptions":{"post":{"description":"Paid with x402 (x402Version 2, scheme upto, USDT on Phase L1, network eip155:1015) or an API key (Authorization: Bearer phk_...). A request without payment gets a 402 whose PAYMENT-REQUIRED header quotes its price; repeat it with the PAYMENT-SIGNATURE header. You pay what the answer actually cost.","operationId":"audio_transcriptions","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"description":"the audio file (at most 25 MB)","format":"binary","type":"string"},"language":{"description":"","type":"string"},"model":{"description":"model id from GET /v1/models (chat routes also take the classes auto, eco, premium, agentic)","type":"string"},"response_format":{"description":"json (default), verbose_json or text","type":"string"}},"required":["model","file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"text":{"description":"","type":"string"}},"type":"object"}}},"description":"the answer"},"402":{"description":"payment required: the x402 quote (PAYMENT-REQUIRED header and JSON body)"}},"summary":"speech to text (multipart: file; priced per second of audio)","x-payment-info":{"price":{"currency":"USD","mode":"dynamic"},"protocols":[{"x402":{}}]}}},"/v1/batches":{"post":{"description":"Paid with x402 (x402Version 2, scheme upto, USDT on Phase L1, network eip155:1015) or an API key (Authorization: Bearer phk_...). A request without payment gets a 402 whose PAYMENT-REQUIRED header quotes its price; repeat it with the PAYMENT-SIGNATURE header. You pay what the answer actually cost.","operationId":"batches","requestBody":{"content":{"application/json":{"schema":{"properties":{"cap":{"description":"the most the batch may spend, micro-USDT (default: the gateway cap)","type":"string"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"id":{"description":"batch id","type":"string"},"status":{"description":"","type":"string"}},"type":"object"}}},"description":"the answer"},"402":{"description":"payment required: the x402 quote (PAYMENT-REQUIRED header and JSON body)"}},"summary":"open a payment batch: one authorization pays many requests (send its id as X-Phase-Batch)","x-payment-info":{"price":{"currency":"USD","mode":"dynamic"},"protocols":[{"x402":{}}]}}},"/v1/chat/completions":{"post":{"description":"Paid with x402 (x402Version 2, scheme upto, USDT on Phase L1, network eip155:1015) or an API key (Authorization: Bearer phk_...). A request without payment gets a 402 whose PAYMENT-REQUIRED header quotes its price; repeat it with the PAYMENT-SIGNATURE header. You pay what the answer actually cost.","operationId":"chat_completions","requestBody":{"content":{"application/json":{"schema":{"properties":{"max_tokens":{"description":"output limit (priced in full in the ceiling)","type":"integer"},"messages":{"description":"the conversation: [{role: system|user|assistant, content}]","items":{"properties":{"content":{"description":"text, or an array of content parts","type":"string"},"role":{"description":"system, user or assistant","type":"string"}},"required":["role","content"],"type":"object"},"type":"array"},"model":{"description":"model id from GET /v1/models (chat routes also take the classes auto, eco, premium, agentic)","type":"string"},"stream":{"type":"boolean"},"temperature":{"description":"","type":"number"},"tools":{"items":{"type":"object"},"type":"array"}},"required":["model","messages"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"choices":{"items":{"properties":{"message":{"properties":{"content":{"description":"","type":"string"},"role":{"description":"","type":"string"}},"type":"object"}},"type":"object"},"type":"array"},"id":{"description":"","type":"string"},"model":{"description":"","type":"string"},"object":{"description":"chat.completion","type":"string"},"usage":{"properties":{"completion_tokens":{"description":"","type":"integer"},"prompt_tokens":{"description":"","type":"integer"}},"type":"object"}},"type":"object"}}},"description":"the answer"},"402":{"description":"payment required: the x402 quote (PAYMENT-REQUIRED header and JSON body)"}},"summary":"OpenAI-compatible chat completion, about 400 models; you pay what the answer cost (scheme upto)","x-payment-info":{"price":{"currency":"USD","mode":"dynamic"},"protocols":[{"x402":{}}]}}},"/v1/embeddings":{"post":{"description":"Paid with x402 (x402Version 2, scheme upto, USDT on Phase L1, network eip155:1015) or an API key (Authorization: Bearer phk_...). A request without payment gets a 402 whose PAYMENT-REQUIRED header quotes its price; repeat it with the PAYMENT-SIGNATURE header. You pay what the answer actually cost.","operationId":"embeddings","requestBody":{"content":{"application/json":{"schema":{"properties":{"input":{"description":"a string or an array of strings","type":["string","array"]},"model":{"description":"model id from GET /v1/models (chat routes also take the classes auto, eco, premium, agentic)","type":"string"}},"required":["model","input"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"embedding":{"items":{"description":"","type":"number"},"type":"array"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"the answer"},"402":{"description":"payment required: the x402 quote (PAYMENT-REQUIRED header and JSON body)"}},"summary":"OpenAI-compatible embeddings","x-payment-info":{"price":{"currency":"USD","mode":"dynamic"},"protocols":[{"x402":{}}]}}},"/v1/images/edits":{"post":{"description":"Paid with x402 (x402Version 2, scheme upto, USDT on Phase L1, network eip155:1015) or an API key (Authorization: Bearer phk_...). A request without payment gets a 402 whose PAYMENT-REQUIRED header quotes its price; repeat it with the PAYMENT-SIGNATURE header. You pay what the answer actually cost.","operationId":"images_edits","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"image":{"description":"the image file","format":"binary","type":"string"},"mask":{"description":"optional mask file","format":"binary","type":"string"},"model":{"description":"model id from GET /v1/models (chat routes also take the classes auto, eco, premium, agentic)","type":"string"},"n":{"description":"","type":"integer"},"prompt":{"description":"the edit","type":"string"},"size":{"description":"WxH","type":"string"}},"required":["model","prompt","image"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"b64_json":{"description":"","type":"string"},"url":{"description":"","type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"the answer"},"402":{"description":"payment required: the x402 quote (PAYMENT-REQUIRED header and JSON body)"}},"summary":"image editing (multipart: image, optional mask; priced per image)","x-payment-info":{"price":{"currency":"USD","mode":"dynamic"},"protocols":[{"x402":{}}]}}},"/v1/images/generations":{"post":{"description":"Paid with x402 (x402Version 2, scheme upto, USDT on Phase L1, network eip155:1015) or an API key (Authorization: Bearer phk_...). A request without payment gets a 402 whose PAYMENT-REQUIRED header quotes its price; repeat it with the PAYMENT-SIGNATURE header. You pay what the answer actually cost.","operationId":"images_generations","requestBody":{"content":{"application/json":{"schema":{"properties":{"model":{"description":"model id from GET /v1/models (chat routes also take the classes auto, eco, premium, agentic)","type":"string"},"n":{"description":"number of images","type":"integer"},"prompt":{"description":"what to draw","type":"string"},"response_format":{"description":"b64_json (default) or url","type":"string"},"size":{"description":"WxH, e.g. 1024x1024","type":"string"}},"required":["model","prompt"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"properties":{"b64_json":{"description":"","type":"string"},"url":{"description":"","type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"the answer"},"402":{"description":"payment required: the x402 quote (PAYMENT-REQUIRED header and JSON body)"}},"summary":"image generation (priced per image)","x-payment-info":{"price":{"currency":"USD","mode":"dynamic"},"protocols":[{"x402":{}}]}}},"/v1/messages":{"post":{"description":"Paid with x402 (x402Version 2, scheme upto, USDT on Phase L1, network eip155:1015) or an API key (Authorization: Bearer phk_...). A request without payment gets a 402 whose PAYMENT-REQUIRED header quotes its price; repeat it with the PAYMENT-SIGNATURE header. You pay what the answer actually cost.","operationId":"messages","requestBody":{"content":{"application/json":{"schema":{"properties":{"max_tokens":{"description":"output limit","type":"integer"},"messages":{"description":"the conversation: [{role: system|user|assistant, content}]","items":{"properties":{"content":{"description":"text, or an array of content parts","type":"string"},"role":{"description":"system, user or assistant","type":"string"}},"required":["role","content"],"type":"object"},"type":"array"},"model":{"description":"model id from GET /v1/models (chat routes also take the classes auto, eco, premium, agentic)","type":"string"},"stream":{"type":"boolean"},"system":{"description":"system prompt","type":"string"}},"required":["model","max_tokens","messages"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"content":{"items":{"properties":{"text":{"description":"","type":"string"},"type":{"description":"","type":"string"}},"type":"object"},"type":"array"},"id":{"description":"","type":"string"},"role":{"description":"assistant","type":"string"},"type":{"description":"message","type":"string"}},"type":"object"}}},"description":"the answer"},"402":{"description":"payment required: the x402 quote (PAYMENT-REQUIRED header and JSON body)"}},"summary":"Anthropic Messages API (Claude SDKs, Claude Code) over the same models","x-payment-info":{"price":{"currency":"USD","mode":"dynamic"},"protocols":[{"x402":{}}]}}},"/v1/rerank":{"post":{"description":"Paid with x402 (x402Version 2, scheme upto, USDT on Phase L1, network eip155:1015) or an API key (Authorization: Bearer phk_...). A request without payment gets a 402 whose PAYMENT-REQUIRED header quotes its price; repeat it with the PAYMENT-SIGNATURE header. You pay what the answer actually cost.","operationId":"rerank","requestBody":{"content":{"application/json":{"schema":{"properties":{"documents":{"items":{"description":"","type":"string"},"type":"array"},"model":{"description":"model id from GET /v1/models (chat routes also take the classes auto, eco, premium, agentic)","type":"string"},"query":{"description":"","type":"string"},"top_n":{"description":"","type":"integer"}},"required":["model","query","documents"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"results":{"items":{"properties":{"index":{"description":"","type":"integer"},"relevance_score":{"description":"","type":"number"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"the answer"},"402":{"description":"payment required: the x402 quote (PAYMENT-REQUIRED header and JSON body)"}},"summary":"rerank documents against a query","x-payment-info":{"price":{"currency":"USD","mode":"dynamic"},"protocols":[{"x402":{}}]}}},"/v1/videos":{"post":{"description":"Paid with x402 (x402Version 2, scheme upto, USDT on Phase L1, network eip155:1015) or an API key (Authorization: Bearer phk_...). A request without payment gets a 402 whose PAYMENT-REQUIRED header quotes its price; repeat it with the PAYMENT-SIGNATURE header. You pay what the answer actually cost.","operationId":"videos","requestBody":{"content":{"application/json":{"schema":{"properties":{"image":{"description":"input image URL for image-to-video models","type":"string"},"model":{"description":"model id from GET /v1/models (chat routes also take the classes auto, eco, premium, agentic)","type":"string"},"prompt":{"description":"","type":"string"},"seconds":{"description":"duration","type":"integer"}},"required":["model","prompt"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"id":{"description":"job id","type":"string"},"status":{"description":"","type":"string"}},"type":"object"}}},"description":"the answer"},"402":{"description":"payment required: the x402 quote (PAYMENT-REQUIRED header and JSON body)"}},"summary":"video generation job (priced per second of video); poll GET /v1/videos/{id}","x-payment-info":{"price":{"currency":"USD","mode":"dynamic"},"protocols":[{"x402":{}}]}}}},"servers":[{"url":"https://router.phase.xyz"}]}
