API Protocols

OpenAI Compatible

Codex, the OpenAI SDK, and any Chat Completions client use this protocol. Base URL includes `/v1`.

Last updated: 2026-08-03

Primary endpoints

EndpointPurpose
GET /v1/modelsList models available to the current Key
POST /v1/chat/completionsOpenAI Chat Completions
POST /v1/responsesOpenAI Responses for Codex and compatible clients
POST /v1/embeddingsText embeddings
POST /v1/images/generationsImage generation when supported by the model
POST /v1/audio/transcriptionsAudio transcription when supported by the model
GET /v1/realtimeRealtime WebSocket when supported by the model
1

Base URL

All OpenAI Compatible requests go to this address.

Base URL
https://www.apihub.ink/v1
2

Authentication

Include a Bearer token in every request header.

Authorization
Authorization: Bearer your-apihub-key
3

Example request

Minimal Chat Completions request.

curl
curl https://www.apihub.ink/v1/chat/completions \
  -H "Authorization: Bearer your-apihub-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"hello"}]}'
4

Responses API example

Codex and Responses clients call /v1/responses. The selected model must support this protocol.

curl
curl https://www.apihub.ink/v1/responses \
  -H "Authorization: Bearer your-apihub-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4-flash","input":"hello"}'
5

Streaming

Set stream: true on Chat Completions or Responses requests to receive an SSE stream. Process events incrementally and use bounded backoff when a connection is interrupted.