Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.crazyrouter.com/llms.txt

Use this file to discover all available pages before exploring further.

Vision via Chat

POST /v1/chat/completions
Crazyrouter production has verified OpenAI-style image_url input on the usual vision models:
  • gpt-4o, gpt-4o-mini, gpt-4.1, gpt-5.4, and other OpenAI vision models
  • Both data:image/...;base64,... data URLs and public https:// URLs work
  • The returned message.content is currently a plain string
Recommended order: for local files, use the image upload endpoint first to get a media.crazyrouter.com temporary URL, then pass it as image_url; or send a base64 data URL directly. Remote public URLs also work, but must satisfy the “Remote URL limits” below.

Using a base64 data URL (most reliable)

curl https://crazyrouter.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": [
          {"type": "text", "text": "What color is this image?"},
          {
            "type": "image_url",
            "image_url": {
              "url": "data:image/png;base64,iVBORw0KGgoAAA..."
            }
          }
        ]
      }
    ],
    "max_tokens": 100
  }'
Sample response:
{
  "model": "gpt-4o-mini",
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Red."
      }
    }
  ]
}

Using a remote https URL

curl https://crazyrouter.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": [
          {"type": "text", "text": "Describe in 5 words."},
          {
            "type": "image_url",
            "image_url": {
              "url": "https://www.gstatic.com/webp/gallery/1.jpg"
            }
          }
        ]
      }
    ],
    "max_tokens": 40
  }'

Remote URL limits

The URL must be reachable from the Crazyrouter server, not merely “openable in a browser”. Common failure modes:
FailureCauseFix
Domain cannot resolvePrivate/invalid hostUse a public https URL
403 ForbiddenSome CDNs (wikimedia, private S3) block server UAs or require RefererUse the upload endpoint or base64
Content-Type not image/*URL returns HTML or redirects to a login pageMake sure it’s a direct image link
File over 20MBSingle-file size limitCompress or crop before uploading
If you see Unable to process the image you provided. Please verify the image URL is publicly accessible, or upload it as base64., the URL is not reachable from the server — work down the table above.
  • For internal assets, private images, or anything whose reachability is uncertain: call POST /v1/files/uploads first for a 72-hour media.crazyrouter.com/... URL, then pass it to image_url
  • For small (< 1MB) or one-off images: send a base64 data URL directly, avoiding an extra upload round-trip
  • Multi-image inputs and detail parameter: the OpenAI upstream supports them; pass them through following OpenAI’s official spec