OpenAI-compatible chat/text completion

Point any OpenAI SDK at this base URL. Routes the messages to the selected model through GenMagic, billed against the key's real USD balance at the model provider's own usage cost (cached input and long-context prompts bill at the prices in /api/v1/models). The request body is forwarded to the model unchanged, so every parameter in the model's supported_parameters works as sent (temperature, tools, response_format, seed, ...). Streams with server-sent events when stream=true. When the key owner has Brand personalization on, a brand system message is prepended automatically.

post/api/v1/chat/completions

Request

  • Base URL: https://genmagic.co
  • URL: https://genmagic.co/api/v1/chat/completions
  • Auth: HTTP bearer

Request body

modelstring

Model id to use. Omit to use the text default. Call /api/v1/models to list ids.

messagesobject[] required

OpenAI-style messages array [{ role, content }]; supports multimodal content parts.

streamboolean

Stream tokens as server-sent events. Defaults to false.

reasoning_effortstring

Thinking effort for a reasoning model, one of the model's capabilities.reasoning_efforts (for example low, medium, high).

reasoningobject

Object form of the thinking controls: { effort, enabled, max_tokens }. enabled: false is refused when the model's capabilities.reasoning_mandatory is true.

Response

Success.

Changes

No recorded changes to this operation across all 1 revision of this API.