haidercodedocs
GitHubLog in

Go

OpenAI-compatible API

Go is a standard OpenAI-shaped API at https://haidercode.ai/v1 — any existing client works.

Base URL and endpoints

Base URL: https://haidercode.ai/v1. Authenticate with an API key:

EndpointWhat it does
GET /v1/modelslist available models
POST /v1/chat/completionschat completions, streaming or not

Point the harness at it

haider provider configure go \
  --kind openai-compatible \
  --origin https://haidercode.ai/v1 \
  --api-key hk-…

curl

curl https://haidercode.ai/v1/chat/completions \
  -H "Authorization: Bearer hk-…" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"hi"}]}'

Streaming

Set "stream": true for server-sent events. The stream includes a usage frame, so token counts are visible to any client — no guessing at cost.

Errors

Errors are OpenAI-shaped JSON, so existing clients handle them unchanged:

StatusMeaning
401missing, malformed, or revoked key
402 insufficient_quotaweekly allowance and usage-credits both exhausted — subscribe or top up
503upstream model provider not configured on the deployment