Endpoint
An AI API relay is most useful when the endpoint is predictable and compatible with existing SDKs. For projects already built around OpenAI-style clients, the best criterion is simple: the base URL should accept familiar chat/completions requests without requiring a rewrite. That makes migration easier for ChatGPT API中转 and GPT API中转 use cases, while still supporting OpenAI兼容 integration patterns.
OPENAI_BASE_URL=https://59api.com/v1
Headers
Keep the header set minimal during the first connection test. A clean smoke test helps isolate problems: authentication errors, model-name mismatches, or network issues. In practice, verify three things: the key is accepted, the request body matches the expected schema, and the response format is stable.
Authorization: Bearer YOUR_API_KEY Content-Type: application/json User-Agent: your-app/1.0
Example
A reliable rollout starts with a short checklist. First, confirm that your client can point to the relay base URL. Second, send a tiny prompt and ask for a short response. Third, compare latency and error behavior across two or three requests. If the relay is intended for production, review whether it supports按量付费 so usage stays aligned with actual demand instead of a fixed bundle that may go unused.
{
"model": "gpt-4o-mini",
"messages": [
{ "role": "user", "content": "Reply with one sentence: relay test passed." }
],
"temperature": 0.2
}