agentbox-inference
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLLM Inference
LLM推理
Paid OpenAI-compatible chat completions API at . Costs $0.001-$0.003 USDC per call via x402 on Solana. Use the tool for all requests.
https://inference.x402.agentbox.fyix_payment付费的兼容OpenAI的聊天补全API,地址为。通过Solana上的x402进行支付,每次调用费用为$0.001-$0.003 USDC。所有请求均需使用工具。
https://inference.x402.agentbox.fyix_paymentEndpoint
端点
Chat Completions
聊天补全
Generate a chat completion from a supported model.
x_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\"}]}"
})Body Parameters:
| 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) |
Message roles: , ,
systemuserassistant从支持的模型生成聊天补全结果。
x_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) |
消息角色: 、、
systemuserassistantModels & Pricing
模型与定价
| Model | Cost/call | Best for |
|---|---|---|
| $0.003 | High-quality output, large context (262K) |
| $0.002 | Balanced quality/cost |
| 模型 | 每次调用费用 | 适用场景 |
|---|---|---|
| $0.003 | 高质量输出、大上下文(262K) |
| $0.002 | 平衡质量与成本 |
Usage Patterns
使用模式
Simple question
简单问题
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?\"}]}"
})With system prompt and parameters
带系统提示词与参数
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}"
})Response Format
响应格式
Standard OpenAI chat completion response:
json
{
"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
}
}标准的OpenAI聊天补全响应:
json
{
"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
}
}Errors
错误说明
| 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 | 上游服务商错误 |
Cost
费用说明
Flat rate per model per call. Price is determined by the field in the request body. Each call is independent - no sessions or state.
model按模型按次收取固定费用。价格由请求体中的字段决定。每次调用相互独立——无会话或状态留存。
model