HiAPI
  • Models
  • Pricing
Search

Search HiAPI models, tools, and resources.

  • Models
  • Pricing
HiAPI

One API, All AI Models

Generate images, video, and audio with leading models through one production-ready API.

Get a free API key

AI Image API

  • All image models
  • GPT Image 2.5 Flare
  • GPT Image 2.5 Sunburst
  • GPT Image 2
  • Nano Banana 2
  • Seedream 5.0 Pro
  • Qwen Image 2.0 Pro
  • FLUX 1.1 Pro

AI Video API

  • All video models
  • Seedance 2.5
  • FLUX.3 Video
  • Seedance 2.0
  • Veo 3.1
  • Kling 3.0

AI Audio API

  • All audio models
  • MiniMax Music 2.6
  • MiniMax Music 1.5
  • ElevenLabs v3
  • Text to music
  • Text to speech

Product

  • Model marketplace
  • Playground
  • Pricing
  • Image API Cost Calculator
  • Free GPT Image 2 Generator
  • Free Background Remover
  • Free Nano Banana Image Generator
  • Outfit Preview
  • Product Photo Lab

Developers

  • Agent setup
  • Documentation
  • API Reference
  • Agent Skills
  • LLM integration index
  • Blog

Company

  • About
  • Contact support
  • Terms of Service
  • Privacy Policy

© 2026 hiapi. All rights reserved.

Open source on GitHubPython SDK on PyPI
  • What you need
  • The minimal working request (curl)
  • The same flow in Python
  • Reasoning effort, thinking, and streaming
  • Production notes
  • Related reading
  • FAQ
Back to blog
TutorialSep 29, 2026

Claude Opus 5.5 API: A Working curl and Python Quickstart

hiapiclaudeanthropicchat-completionsapi-tutorial

Latest models

  • GPT Image 2.5 Flare50% offFrom $0.050/image$0.025/image
  • GPT Image 2.5 Sunburst50% offFrom $0.050/image$0.025/image
  • GPT Image 2From $0.030/image
  • Nano Banana 250% offFrom $0.036/image$0.018/image
View all models

Explore models

TextChat and reasoningImageGenerate and editVideoText and image to videoAudioSpeech and music
Contents
  • What you need
  • The minimal working request (curl)
  • The same flow in Python
  • Reasoning effort, thinking, and streaming
  • Production notes
  • Related reading
  • FAQ

Claude Opus 5.5 is Anthropic's newest agentic-coding and long-context reasoning model, and hiapi exposes it the same day it lands on the platform. Unlike hiapi's image, video, and audio models — which all go through the async POST /v1/tasks → poll pattern — Claude Opus 5.5 is a text-only chat model, so you call it with a single, synchronous request to /v1/chat/completions. This guide gives you a working curl call, the same call in Python, and the production details (reasoning effort, streaming, error handling) you need before you ship it.

What you need

  • A hiapi account and an API key. Create one from API Keys — every hiapi model, including Claude Opus 5.5, shares the same key.
  • No SDK install required. Claude Opus 5.5 uses hiapi's OpenAI-compatible Chat Completions format, so any HTTP client (curl, requests, fetch) works out of the box.

The minimal working request (curl)

curl -X POST "https://api.hiapi.ai/v1/chat/completions" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-5-5",
    "messages": [
      { "role": "user", "content": "Give me three tips for reviewing a Python pull request." }
    ],
    "stream": false
  }'

The model id is passed bare — no route suffix, no provider prefix. A successful call returns a standard chat-completion object:

{
  "id": "msg_...",
  "object": "chat.completion",
  "model": "claude-opus-5-5",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "1. ..." },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 13,
    "completion_tokens": 42,
    "total_tokens": 55,
    "usage_semantic": "openai",
    "usage_source": "anthropic"
  }
}

Read the answer from choices[0].message.content — there's no output[0].url to poll for, and no task id to track.

The same flow in Python

import requests

response = requests.post(
    "https://api.hiapi.ai/v1/chat/completions",
    headers={
        "Authorization": "Bearer sk-YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "model": "claude-opus-5-5",
        "messages": [
            {"role": "user", "content": "Give me three tips for reviewing a Python pull request."}
        ],
        "stream": False,
    },
)
response.raise_for_status()
data = response.json()
print(data["choices"][0]["message"]["content"])

Because the endpoint speaks the OpenAI Chat Completions wire format, this same payload shape also works unmodified through any HTTP client in any language — there's nothing hiapi-specific to learn beyond the base URL and the bearer key.

Reasoning effort, thinking, and streaming

Claude Opus 5.5 keeps extended thinking always on — you can't disable it or hand it a manual token budget. What you control is how much of it the model does, via output_config.effort:

{
  "model": "claude-opus-5-5",
  "messages": [{ "role": "user", "content": "..." }],
  "output_config": { "effort": "medium" }
}

effort accepts low, medium (the default if you omit the field), high, xhigh, or max — going from fast/cheap answers to deep, deliberate ones. The response's message includes a reasoning_details array holding the model's internal thinking trace; for a simple one-shot call you can safely ignore it and just read message.content.

For long answers, set "stream": true to get incremental output instead of waiting for the full response:

curl -N https://api.hiapi.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-opus-5-5","messages":[{"role":"user","content":"..."}],"stream":true}'

Each chunk is a data: {...} line shaped like chat.completion.chunk, with the incremental text in choices[0].delta.content. Keep reading chunks until one arrives with a non-null finish_reason (normally "stop") — that's the end of the response.

Claude Opus 5.5 also supports tool/function calling and has a 1M-token context window with up to 128K tokens of output, so it's built for large-codebase or long-document tasks, not just short Q&A.

Production notes

  • Auth errors are 401, not 400. A missing or invalid key returns:

    { "error": { "code": "permission_denied", "message": "This API key is invalid...", "type": "hiapi_error", "request_id": "..." } }
    

    Check for HTTP 401 specifically and surface the request_id if you need to contact support — see the full invalid API key troubleshooting guide for other causes of this error.

  • There's no callback/webhook option here. That pattern exists for hiapi's async task-based models (image, video, audio); Chat Completions is request/response only, so stream: true is your only alternative to a single blocking call.

  • This call is idempotent by nature — there's no task id to accidentally double-create, so retries on timeout are safe as long as you're comfortable re-running the same prompt.

  • Watch your rate limits on high-concurrency workloads; see how to handle a 429 rate-limit error for backoff strategy.

  • Token pricing (input, output, and cached tokens are billed separately) is kept current on the Claude Opus 5.5 model page and the pricing page — don't hardcode numbers in your billing logic, read them from there.

Related reading

  • Claude Opus 5.5 model page — full spec sheet and live pricing
  • Claude Sonnet 4.6 API guide — a lighter, faster Claude option on the same Chat Completions format
  • Building an OpenAI-compatible proxy in Python — useful if you're fronting multiple chat models behind one internal API
  • Manage your API keys

FAQ

Does the Claude Opus 5.5 API support streaming? Yes — set "stream": true and read the data: {...} chunks as described above.

Do I need an API key to call Claude Opus 5.5 in production? Yes. Every request must carry Authorization: Bearer sk-<your key>; there's no keyless or anonymous access to the production API.

Can I turn off Claude Opus 5.5's thinking to save tokens? No. Thinking is always on for this model; the only control you have is the output_config.effort level (low through max), which trades speed/cost for depth.

Is Claude Opus 5.5 called through /v1/tasks like hiapi's image models? No. Only hiapi's image, video, and audio models use the async task-and-poll pattern. Claude Opus 5.5 is a text model on /v1/chat/completions and returns its answer in the same response.

What's the context window and max output length? 1,000,000 tokens of context and up to 128,000 tokens of output — large enough for whole-repo or long-document prompts.

Does Claude Opus 5.5 support tool/function calling? Yes, alongside streaming and the OpenAI-compatible message format.

Latest models

Explore models

Generate it with HiAPI

Choose a model, enter your prompt, and see the result.

Start generatingView model pricing

HiAPI Blog

Related articles

View all articles
Seedance 2.0 Video Prompt: A 15-Second Product Launch Film, Beat by Beat

Seedance 2.0 Video Prompt: A 15-Second Product Launch Film, Beat by Beat

API Keys Data Are Invalid: What Causes This Error and How to Fix It

API Keys Data Are Invalid: What Causes This Error and How to Fix It

How to Use the grok-4.6 API: cURL, Python, and a Working Request

How to Use the grok-4.6 API: cURL, Python, and a Working Request

Virtual Staging API: Turn Empty Room Photos into Staged Listings with AI

Virtual Staging API: Turn Empty Room Photos into Staged Listings with AI

GPT Image 2 / 2.5 with n8n: The request worked. Where is the image?

GPT Image 2 / 2.5 with n8n: The request worked. Where is the image?

How to Use Claude Opus 4.8 via the hiapi API

How to Use Claude Opus 4.8 via the hiapi API

HiAPI

Generate it with HiAPI

Start generating
View all models
GPT Image 2.5 Flare50% offFrom $0.025/image
GPT Image 2.5 Sunburst50% offFrom $0.025/image
GPT Image 2From $0.030/image
Nano Banana 250% offFrom $0.018/image
Text
Image
Video
Audio