nexusflow
Online

Quick Start

Start with your first request. Choose OpenAI, Anthropic Messages, or Gemini-compatible protocol, and understand when to switch to async task mode.

Three Sync Protocols
OpenAI, Anthropic, and Gemini compatible endpoints share the same model set.
Async Tasks
Images and videos uniformly use `/v1/tasks` for submission and polling.
Production Traffic
Review rate limits, error codes, and monitoring pages before launch.

Choose a Compatible Protocol

Prerequisites

1

Install SDK

Use the OpenAI SDK by default. If you already have an Anthropic or Gemini client, check the corresponding protocol documentation directly.

Python
pip install openai
Node.js
npm install openai
2

Configure API

Point base_url to NexusFlow and use a unified API Key to access all models.

Base URLhttps://nexusflow.vip/v1
API Keysk-air-xxxxxxxx(Get API Key)
Authentication MethodAuthorization: Bearer {API_KEY}
3

Send a Chat Request

Text and reasoning models should prefer the synchronous API. The following example uses Qwen3.5 Plus.

from openai import OpenAI

client = OpenAI(
    api_key="sk-air-your-key",
    base_url="https://nexusflow.vip/v1",
)

response = client.chat.completions.create(
    model="qwen3.5-plus",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello, please introduce yourself."}
    ],
    temperature=0.7,
    max_tokens=1000
)

print(response.choices[0].message.content)
4

Integrate Async Tasks

When integrating image or video generation, we recommend uniformly using /v1/tasks. This pipeline is better suited for high-latency models, background batch tasks, and high-concurrency queuing.

curl -X POST https://nexusflow.vip/v1/tasks \
  -H "Authorization: Bearer sk-air-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.0-t2v",
    "prompt": "City coastline at dusk, slow camera push, cinematic natural lighting",
    "duration": 10,
    "resolution": "720P"
  }'

# Poll task status
curl https://nexusflow.vip/v1/tasks/task_xxx \
  -H "Authorization: Bearer sk-air-your-key"

High-Concurrency Tips

Separate chat requests and multimedia tasks into different queues to avoid competing for throughput.
The same API Key can be used for OpenAI, Anthropic Messages, and Gemini-compatible protocols.
Task polling should be every 3-5 seconds, using exponential backoff for failed retries.
Before load testing, confirm RPM/TPM and concurrency strategies on the rate limits page.
Tips
  • Replace the model parameter with another model ID to switch models
  • All models share the same API Key - no need to apply separately
  • OpenAI, Anthropic Messages, and Gemini-compatible protocols share the same balance and usage records
  • Streaming output is supported - just set stream: true
  • Images and videos should use /v1/tasks to avoid synchronous blocking
💡 Cost Savings Tip: Context Caching

For repeated system prompts or long document contexts, enable enable_context_caching: true (OpenAI protocol) or cache_control annotations (Anthropic protocol). Cached hit portions are billed at only 10% of the input price. See Billing Details.

Next Steps