What to do when the first API request fails
Troubleshoot the first request in order: endpoint, authentication header, model, balance, and error code.
The problem
Creating an API key is not the same as completing a first-request verification. Check host, auth, model, balance, and parsing.
Shortest working configuration
.envbash
export OPENAI_API_KEY=your_gpt88_api_key
export OPENAI_BASE_URL=https://api.gpt88.cc/v1
export OPENAI_MODEL=gpt-5.6-solKeep API keys in server-side environment variables or a secret manager. Never commit them or expose them in frontend code.
Complete examples
request.shbash
curl https://api.gpt88.cc/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","messages":[{"role":"user","content":"返回 OK"}],"max_tokens":32}'request.pypython
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["OPENAI_API_KEY"],
base_url=os.getenv("OPENAI_BASE_URL", "https://api.gpt88.cc/v1"),
)
response = client.chat.completions.create(
model=os.getenv("OPENAI_MODEL", "gpt-5.6-sol"),
messages=[{"role": "user", "content": "返回 OK"}],
max_tokens=32,
)
print(response.choices[0].message.content)request.mjsjavascript
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
baseURL: process.env.OPENAI_BASE_URL ?? "https://api.gpt88.cc/v1",
});
const response = await client.chat.completions.create({
model: process.env.OPENAI_MODEL ?? "gpt-5.6-sol",
messages: [{ role: "user", content: "返回 OK" }],
max_tokens: 32,
});
console.log(response.choices[0].message.content);Common errors
- 401: recopy the key.
- 404: use api.gpt88.cc/v1/chat/completions.
- 400 model_not_found: copy the exact ID.
- 429: back off.
- Timeout: test DNS and TLS with cURL.
Pricing and billing
Record one successful request as the cost baseline.