API Documentation

Compatible with OpenAI & Anthropic SDKs — integrate in 5 minutes.

menu_book

Full Documentation Site

More complete integration guides, model references and best practices live on the standalone docs site.

arrow_forward

Base URL

https://your-domain.com

OpenAI Authentication

Authorization: Bearer sk-xxx

Anthropic Authentication

x-api-key: sk-xxx

Quick Start

Get started with Zivv API in 3 simple steps.

1

Register & Get API Key

Sign up at the console, go to API Keys page, and create a new key starting with sk-.

2

Set Base URL

Point your OpenAI SDK base_url to https://zivv.pro/v1, or set ANTHROPIC_BASE_URL=https://zivv.pro for Claude Code.

3

Start Calling

Use your existing code — just swap the base URL and API key. All OpenAI and Anthropic SDK features are supported.

API Endpoints

Zivv API supports both OpenAI and Anthropic protocol formats.

MethodEndpointDescription
POST/v1/chat/completionsChat Completions (OpenAI format, streaming supported)
POST/v1/messagesMessages (Anthropic format, streaming supported)
POST/v1/responsesResponses (OpenAI Responses API, for Codex CLI)
POST/v1/images/generationsImage Generation (supports streaming SSE output)
POST/v1/gemini/{model}:{method}Gemini native protocol passthrough (generateContent / streamGenerateContent)
GET/v1/modelsList available models

Code Examples

Drop-in replacement — just change your base URL.

curl https://your-domain.com/v1/chat/completions \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Client Configuration

Step-by-step guides for popular AI tools and SDKs.

Set environment variables and launch Claude Code. No extra configuration needed.

export ANTHROPIC_BASE_URL=https://your-domain.com
export ANTHROPIC_API_KEY=sk-your-key
claude

Request Parameters

Supported parameters by protocol. Select a protocol to see its parameters.

ParameterTypeRequiredDescription
modelstringYesModel ID, e.g. claude-sonnet-4-6
messagesarrayYesArray of message objects with role and content
streambooleanNoEnable streaming output, default false
temperaturenumberNoSampling temperature, 0-2
top_pnumberNoNucleus sampling parameter
max_tokensnumberNoMaximum output tokens
max_completion_tokensnumberNoAlternative to max_tokens, same behavior
toolsarrayNoFunction tool definitions for tool use
tool_choicestring|objectNoTool selection strategy: auto / required / none / specific tool

Image Generation

Use the Images API with gpt-image-2 to generate images, with streaming SSE support.

💡 Recommended: enable stream mode. Image generation typically takes 30-120 seconds; streaming avoids Cloudflare / gateway timeouts.
📝 For image editing (modifying existing images), use the Responses API (/v1/responses) with text models like gpt-5.5 and the image_generation tool.

Code Examples

curl https://your-domain.com/v1/images/generations \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A cute cat wearing sunglasses on a beach",
    "stream": true,
    "size": "1024x1024",
    "quality": "high"
  }'

SSE Streaming Response Format

With stream enabled, the server returns generation progress and the final image (base64) via SSE chunks.

SSE Events
event: progress
data: {"type":"progress","progress":25}

event: progress
data: {"type":"progress","progress":50}

event: progress
data: {"type":"progress","progress":75}

event: result
data: {"type":"result","index":0,"b64_json":"iVBORw0KGgo..."}

event: done
data: [DONE]

Responses API

The OpenAI Responses API (/v1/responses) is the native interface for newer models like gpt-5.5, supporting vision and image generation.

💡 For gpt-5.5 with images, use the Responses API. Image type is input_image, and image_url is a plain string — no object wrapper needed.
📝 Use tools: [{type: "image_generation"}] to let text models generate images, including image editing (modifying existing images).

Vision & Image Generation

The Responses API supports both image input (vision) and image generation (via the image_generation tool).

# Vision: send image to gpt-5.5
curl https://your-domain.com/v1/responses \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "input": [
      {
        "role": "user",
        "content": [
          { "type": "input_text", "text": "What is in this image?" },
          { "type": "input_image", "image_url": "https://example.com/photo.jpg" }
        ]
      }
    ]
  }'

# Image generation via Responses API
curl https://your-domain.com/v1/responses \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "input": "Generate an image of a sunset over mountains",
    "tools": [{ "type": "image_generation" }]
  }'

chat/completions vs responses

chat/completionsresponses
Request fieldmessagesinput
Image typeimage_urlinput_image
Image URL format{url: "..."}"..."
Image generationimage_generation tool
Response structurechoices[].messageoutput[]
Multi-turnprevious_response_id

Ready to Get Started?

Create an account and get your API key in seconds.