Loading...
Loading...
Compare original and translation side by side
https://inference.x402.agentbox.fyix_paymenthttps://inference.x402.agentbox.fyix_paymentx_payment({
"url": "https://inference.x402.agentbox.fyi/v1/chat/completions",
"method": "POST",
"body": "{\"model\": \"moonshotai/kimi-k2.5\", \"messages\": [{\"role\": \"user\", \"content\": \"Explain x402 in one sentence\"}]}"
})| Param | Type | Required | Description |
|---|---|---|---|
| model | string | yes | Model ID (see table below) |
| messages | array | yes | Array of |
| max_tokens | integer | no | Maximum tokens to generate |
| temperature | number | no | Sampling temperature (0-2) |
| top_p | number | no | Nucleus sampling (0-1) |
systemuserassistantx_payment({
"url": "https://inference.x402.agentbox.fyi/v1/chat/completions",
"method": "POST",
"body": "{\"model\": \"moonshotai/kimi-k2.5\", \"messages\": [{\"role\": \"user\", \"content\": \"Explain x402 in one sentence\"}]}"
})| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| model | 字符串 | 是 | 模型ID(见下表) |
| messages | 数组 | 是 | 包含 |
| max_tokens | 整数 | 否 | 生成的最大tokens数量 |
| temperature | 数字 | 否 | 采样温度(0-2) |
| top_p | 数字 | 否 | 核采样(0-1) |
systemuserassistant| Model | Cost/call | Best for |
|---|---|---|
| $0.003 | High-quality output, large context (262K) |
| $0.002 | Balanced quality/cost |
| 模型 | 每次调用费用 | 适用场景 |
|---|---|---|
| $0.003 | 高质量输出、大上下文(262K) |
| $0.002 | 平衡质量与成本 |
x_payment({
"url": "https://inference.x402.agentbox.fyi/v1/chat/completions",
"method": "POST",
"body": "{\"model\": \"moonshotai/kimi-k2.5\", \"messages\": [{\"role\": \"user\", \"content\": \"What is the x402 protocol?\"}]}"
})x_payment({
"url": "https://inference.x402.agentbox.fyi/v1/chat/completions",
"method": "POST",
"body": "{\"model\": \"moonshotai/kimi-k2.5\", \"messages\": [{\"role\": \"user\", \"content\": \"What is the x402 protocol?\"}]}"
})x_payment({
"url": "https://inference.x402.agentbox.fyi/v1/chat/completions",
"method": "POST",
"body": "{\"model\": \"moonshotai/kimi-k2.5\", \"messages\": [{\"role\": \"system\", \"content\": \"You are a concise technical writer.\"}, {\"role\": \"user\", \"content\": \"Write a summary of Solana's transaction model\"}], \"max_tokens\": 500, \"temperature\": 0.7}"
})x_payment({
"url": "https://inference.x402.agentbox.fyi/v1/chat/completions",
"method": "POST",
"body": "{\"model\": \"moonshotai/kimi-k2.5\", \"messages\": [{\"role\": \"system\", \"content\": \"You are a concise technical writer.\"}, {\"role\": \"user\", \"content\": \"Write a summary of Solana's transaction model\"}], \"max_tokens\": 500, \"temperature\": 0.7}"
}){
"id": "gen-...",
"object": "chat.completion",
"model": "moonshotai/kimi-k2.5",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "..." },
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 42,
"total_tokens": 54
}
}{
"id": "gen-...",
"object": "chat.completion",
"model": "moonshotai/kimi-k2.5",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "..." },
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 42,
"total_tokens": 54
}
}| HTTP | Meaning |
|---|---|
| 400 | Invalid request (check model name and messages format) |
| 402 | Payment required (handled automatically by x_payment) |
| 502 | Upstream provider error |
| HTTP状态码 | 含义 |
|---|---|
| 400 | 请求无效(检查模型名称和消息格式) |
| 402 | 需要支付(由x_payment自动处理) |
| 502 | 上游服务商错误 |
modelmodel