跳转到主要内容

前置条件

调用 API

1

设置您的 API 密钥

Poixe 控制台 获取您的 API 密钥并将其设置为环境变量:
export POIXE_API_KEY='your-api-key-here'
2

进行您的第一次 API 调用

运行此命令以发送您的第一次 Poixe API 请求:
curl https://api.poixe.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $POIXE_API_KEY" \
  -d '{
    "model": "gpt-5.2",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'
示例输出:
{
  "id": "chatcmpl-Cvjc7QFlcx3QrvEd7lysmzU849xQf",
  "object": "chat.completion",
  "created": 1767876071,
  "model": "gpt-5.2-2025-12-11",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hi—what can I help you with today?",
        "refusal": null,
        "annotations": []
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 7,
    "completion_tokens": 13,
    "total_tokens": 20,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "audio_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0,
      "audio_tokens": 0,
      "accepted_prediction_tokens": 0,
      "rejected_prediction_tokens": 0
    }
  },
  "service_tier": "default",
  "system_fingerprint": null
}