Language Models

Format Guide

Language models can expose one or more public request formats. Pick the format that matches your SDK and the model's native capabilities.

Base URL: https://shark.ai/api/v1
Check a model's supportedProtocols before choosing a format. OpenAI Format is the broad compatibility default; Anthropic and Gemini formats are preferred when the model supports them natively.

Protocol Selection

FormatEndpointUse when
OpenAI FormatPOST /chat/completionsYou want OpenAI SDK compatibility or one common chat interface across providers.
Anthropic FormatPOST /messagesThe model supports anthropic_messages, especially for Claude-style tool use, thinking blocks, and signatures.
Gemini FormatPOST /models/{model}:generateContentThe model supports gemini_generate_content, especially for native Gemini parts, multimodal inputs, and generationConfig.

For Anthropic / Claude Models

Prefer Anthropic Format when available. It preserves Anthropic-native content blocks, tool use, thinking blocks, and returned thinking signatures more completely than the OpenAI-compatible bridge.

For Gemini Models

Prefer Gemini Format when available. It exposes native contents, parts, generationConfig, and Gemini multimodal behavior.

Compatibility Notes

OpenAI Format can route to providers whose native APIs are not OpenAI-shaped. Model Hub translates common chat fields, multimodal content blocks, streaming, token usage, and OpenAI-style tool calls where supported.

Gemini image-preview models may attach a provider-side thoughtSignature to generated image parts. In OpenAI Format responses, Model Hub encodes it in the returned data URI. Pass returned image_url.url values back unchanged for multi-turn image editing.

{
  "type": "image_url",
  "image_url": {
    "url": "data:image/png;thought_signature=...;base64,..."
  }
}

Anthropic reasoning models can return thinking blocks with signatures. In OpenAI Format responses, Model Hub exposes them as message.reasoning_details. If you continue the conversation through OpenAI Format, include the assistant message with its reasoning_details unchanged so the gateway can restore Anthropic thinking blocks.

{
  "role": "assistant",
  "content": "Final answer text.",
  "reasoning_details": [
    {
      "type": "thinking",
      "thinking": "...",
      "signature": "..."
    }
  ]
}

Provider-native features do not always map perfectly across formats. If exact Anthropic or Gemini semantics matter, use the corresponding native-compatible format instead of the OpenAI-compatible bridge.