cURL Examples
All gpt88.cc APIs can be called directly with cURL for quick validation, shell automation, and CI health checks.
Health check
Prepare the environment first and confirm both the API key and the network path are valid.
Replace sk-xxx below with the key created in the Agent API Keys.
# 1. Export your API key
export GPT88_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx
# 2. Check authentication and network reachability
curl -s -o /dev/null -w "%{http_code}\n" \
https://api.gpt88.cc/v1/models \
-H "Authorization: Bearer $GPT88_API_KEY"
# expected: 200List models
Use jq to extract model IDs for scripts and automation.
curl https://api.gpt88.cc/v1/models \
-H "Authorization: Bearer $GPT88_API_KEY" | jq '.data[].id'Call chat/completions
curl https://api.gpt88.cc/v1/chat/completions \
-H "Authorization: Bearer $GPT88_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-8",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Introduce gpt88.cc in under 30 words"}
]
}'The response shape matches the OpenAI schema. For the full request and response contract, see POST /v1/chat/completions.
Streaming
# -N disables output buffering so SSE arrives in real time
curl -N https://api.gpt88.cc/v1/chat/completions \
-H "Authorization: Bearer $GPT88_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-8",
"stream": true,
"messages": [{"role": "user", "content": "Tell a short joke about API gateways"}]
}'Retry with backoff
In production, handle 429 and 5xx explicitly. This is a minimal retry template you can drop into CI or debugging scripts.
#!/usr/bin/env bash
set -euo pipefail
call() {
curl -sS -w "\n%{http_code}" \
https://api.gpt88.cc/v1/chat/completions \
-H "Authorization: Bearer $GPT88_API_KEY" \
-H "Content-Type: application/json" \
-d "$1"
}
PAYLOAD='{"model":"claude-opus-4-8","messages":[{"role":"user","content":"hi"}]}'
for i in 1 2 3; do
RESP=$(call "$PAYLOAD")
CODE=$(echo "$RESP" | tail -n1)
BODY=$(echo "$RESP" | sed '$d')
if [ "$CODE" -lt 400 ]; then
echo "$BODY"
exit 0
fi
case "$CODE" in
408|429|500|502|503|504)
sleep $((2 ** (i - 1)))
;;
*)
echo "Non-retryable error $CODE: $BODY" >&2
exit 1
;;
esac
done
echo "Exhausted retries" >&2
exit 1For status-code meanings and retry guidance, see Error Codes.