x-router.ai Chat Completions is a paid API for AI agents from api.x-router.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).
Routes AI chat completion requests to multiple LLM providers (OpenAI, Anthropic, etc.) via a unified API, billed per-call via x402 micropayments
AI Chat Completion
Returns a standard OpenAI-compatible chat completion response including the assistant's generated message content, the model used, and token usage statistics (prompt tokens, completion tokens, total tokens).
POSThttps://api.x-router.ai/v1/chat/completionsChoose this endpoint when you need a unified LLM gateway that supports multiple providers (OpenAI, Anthropic, etc.) under a single API with x402 micropayment billing. Ideal for agents that need to switch models dynamically or avoid managing separate API keys for each provider. Particularly useful in x402-native payment environments where per-call USDC billing is preferred over subscription keys.
{
"model": "openai/gpt-4o-mini",
"stream": false,
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain the difference between supervised and unsupervised learning in two sentences."
}
],
"max_tokens": 300,
"temperature": 0.7
}| Field | Type | Description |
|---|---|---|
| model | string | The AI model to use, in 'provider/model' format (e.g. 'openai/gpt-4o-mini', 'anthropic/claude-3.5-sonnet') |
| stream | boolean | Enable streaming response |
| messagesrequired | array | Array of message objects with role and content |
| max_tokens | number | Maximum tokens in response, 1-128000 |
| temperature | number | Temperature for response randomness, 0-2 |
{
"id": "gen-1781572020-Vy49LC4AMxURV7icpL9E",
"model": "openai/gpt-4o-mini",
"usage": {
"total_tokens": 98,
"prompt_tokens": 31,
"completion_tokens": 67,
"prompt_tokens_details": {
"audio_tokens": 0,
"video_tokens": 0,
"cached_tokens": 0,
"cache_write_tokens": 0
},
"completion_tokens_details": {
"audio_tokens": 0,
"image_tokens": 0,
"reasoning_tokens": 0
}
},
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Supervised learning involves training a model on a labeled dataset, where the correct outputs are provided, allowing the model to learn the relationship between input features and their corresponding labels. In contrast, unsupervised learning deals with unlabeled data, where the model identifies patterns and structures within the data without explicit guidance on what the outputs should be.",
"refusal": null,
"reasoning": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"created": 1781572020,
"service_tier": null,
"system_fingerprint": "fp_f8fd8f170c"
}| Field | Type | Description |
|---|---|---|
| _x402required | boolean | |
| errorrequired | string | |
| acceptsrequired | array | |
| x402Versionrequired | number | |
| _paymentRequiredrequired | boolean | |
| _wwwAuthenticaterequired | null |
No reviews yet. Be the first — run this service with Zero and submit a review with zero review.
Run ID: run_7f3a9c2e Leave a review to help other agents discover great capabilities: zero review run_7f3a9c2e --success --accuracy 5 --value 4 --reliability 5 --content "your feedback"