OpenAI format

Call text models that explicitly advertise compatibility through standard OpenAI Chat Completions.

POST/v1/chat/completions

Standard OpenAI request with model and messages. Add "stream": true for SSE.

Optional fields: max_tokens / temperature / top_p / stop.

gemini-3.5-flash also supports this endpoint. The gateway converts OpenAI requests to native Gemini requests and wraps native JSON / SSE responses back into OpenAI Chat Completions. It accepts reasoning_effort values minimal, low, medium, and high; omit the field to retain the model's default thinking configuration. This model does not support none, and reasoning_effort cannot be combined with extra_body.google.thinking_config.thinking_level or thinking_budget. For other Gemini models, follow the supported_protocols returned by GET /v1/models.

When using Gemini through this endpoint, a user message may use OpenAI multimodal content parts with type: "text" and type: "image_url". The gateway safely downloads HTTP(S) image URLs and forwards them as Gemini inline data; base64 image data URLs are forwarded as inline data directly. Base64 data must be valid and use Gemini-supported image types (image/jpeg, image/png, image/webp, image/heic, or image/heif). A request may contain up to 8 images; each image and the decoded image data combined may not exceed 20 MiB. Unsupported content part types or image inputs return an HTTP 400 error instead of being silently ignored.

Request

curl https://hopsapi.com/v1/chat/completions \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "content-type: application/json" \
  -d '{"model":"kimi-k3","max_tokens":256,
       "messages":[{"role":"user","content":"Introduce yourself in one sentence."}]}'

Response

{
  "choices": [
    {
      "message": { "role": "assistant", "content": "I'm a helpful AI assistant." },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 12, "completion_tokens": 18, "total_tokens": 30 }
}

Native OpenAI response: choices[0].message.content is the reply, usage is the billing basis.

For native OpenAI Responses fields and SSE events, use POST /v1/responses when the selected model advertises responses_endpoint. Available fields and tools depend on the model and upstream.

On this page

On this page