Skip to main content
The OpenAI-native protocol. Speaks Chat Completions verbatim, so any client built for the Chat Completions API (the OpenAI Python / Node SDKs, LangChain default, LlamaIndex, etc.) works unchanged — just point the base URL at https://llm.bytespike.ai/v1 and swap the key. Non-GPT models (Claude, Gemini, DeepSeek, Doubao) are translated under the hood.

When to use

Pick this endpoint when you want:
  • Drop-in replacement for openai SDK calls (OpenAI(base_url=…, api_key=…))
  • OpenAI-only features like response_format: {"type": "json_schema"} or logprobs
  • Frameworks that hard-code the OpenAI shape
For tool calling, the OpenAI tool_calls shape works as-is. For prompt caching on Claude, prefer /v1/messages — the OpenAI shape can’t carry cache_control.

Request

Headers

Body

Response

Response fields

Accounting headers

Same envelope as every other endpoint:
Full breakdown in the API Reference overview.

Streaming

Set "stream": true. The response is SSE with data: {json} lines and a terminating data: [DONE]:
Token usage is shipped on the final non-[DONE] frame when stream_options: {"include_usage": true} is set.

Tool calling

Tools follow OpenAI’s function shape. Round-trip via two requests:

Round 1 — tool offered

Response:
Note arguments is a JSON string, not an object — that’s the OpenAI convention.

Round 2 — tool result returned

Vision (image_url content)

Send images via image_url content blocks. Both data URLs and HTTPS URLs work; the gateway forwards bytes to vision-capable models (GPT-5-x, Claude Sonnet/Opus 4.x, Gemini, Doubao Vision).
The detail field ("low" / "high" / "auto") is honored on models that support it.

Cross-model routing

This endpoint accepts any ByteSpike catalog model in the model field — the gateway translates the OpenAI shape to each model’s native protocol transparently:
Caveats:
  • response_format: {"type": "json_schema"} requires a model that supports structured outputs natively (GPT 4.x+, some Gemini Pro variants). Other models return a 400 unsupported_feature.
  • seed is best-effort; cross-model determinism isn’t guaranteed.
  • tool_calls.arguments always returns a JSON string regardless of model — even on Claude models that internally return structured input.
Full catalog: GET /v1/models. Pricing per model: bytespike.ai/pricing.

Rate limiting & quota headers

Errors

All non-2xx responses are free — failures don’t bill. Body shape matches OpenAI’s error envelope:

SDK example

OpenAI Python SDK, base URL flipped:
No SDK fork needed — the upstream openai package is the one we test against.