nexusflow
Online
Feature

Multi-Protocol Support

Use familiar SDKs to connect to one gateway, with unified auth, billing, and monitoring

nexusflow currently exposes three public protocols: OpenAI Chat Completions, Anthropic Messages, and Responses API. Internally these protocols connect through a compatibility layer to the same model routing, billing, and monitoring pipeline, so you can keep using familiar SDKs without leaking provider differences into your application. The Responses API offers built-in tools (web search, code interpreter, etc.) and previous_response_id multi-turn context management, ideal for complex tasks.

⚠ Protocol Coverage
/v1/chat/completions
Supported by all models
/v1/messages
Supported by all models
/v1/responsesQwen series only; calling DeepSeek / GLM / Kimi / MiniMax returns Unsupported model, so use the first two endpoints instead.

Supported Protocols

ProtocolEndpoint PrefixSDKMain Use
OpenAI Chat Completions/v1/chat/completionsOpenAI SDKText chat, function calling
OpenAI Image Generations/v1/images/generationsOpenAI SDKImage generation
OpenAI Embeddings/v1/embeddingsOpenAI SDKText embedding
Anthropic Messages/v1/messagesAnthropic SDKText chat, function calling
Responses API/v1/responsesOpenAI SDKBuilt-in tools, multi-turn context

Not all models support all protocols. The model detail page shows each model's currently available supported_protocols.

Protocol Scope

The current NexusFlow public API lists only directly callable compatible endpoints. The model detail page shows the actual supported_protocols for each model.

Protocol / APIEndpointStatusDescription
OpenAI Chat Completions/v1/chat/completionsAvailableRecommended default endpoint for text, reasoning, multimodal, and coding models.
Anthropic Messages/v1/messagesAvailableCompatible with the Anthropic SDK and the Messages request/streaming event format.
Responses API/v1/responsesAvailableBuilt-in tools like web search and code interpreter, simplifying multi-turn context management.
OpenAI Image Generations/v1/images/generationsAvailableSynchronous compatible endpoint for image generation; complex image/video tasks can also use /v1/tasks.
OpenAI Embeddings/v1/embeddingsAvailableEndpoint for text embedding models.
NexusFlow Tasks/v1/tasksAvailableUnified endpoint for image and video async tasks.

Reference: OpenAI Chat Completions API Reference.

OpenAI Protocol

This is the most universal protocol, supported by most models. Compatible with the OpenAI Chat Completions API spec.

Basic Setup

from openai import OpenAI

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

# Basic chat
response = client.chat.completions.create(
    model="qwen3-max",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

Streaming

stream = client.chat.completions.create(
    model="qwen3-max",
    messages=[{"role": "user", "content": "Hello!"}],
    stream=True,
)
for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Image Generation

Models that support the openai:image-generations protocol can generate images via the OpenAI SDK.

response = client.images.generate(
    model="wan2.6-t2i",
    prompt="A futuristic city at sunset, cyberpunk style",
    size="1024x1024",
    n=1,
)
print(response.data[0].url)

Text Embedding

Models that support the openai:embeddings protocol can convert text into vector representations for semantic search, clustering, RAG, and similar use cases.

response = client.embeddings.create(
    model="text-embedding-v4",
    input="Your text string goes here",
)
print(response.data[0].embedding[:5])

Anthropic Protocol

Provides an Anthropic Messages compatible endpoint, making it easy to connect to nexusflow's unified model gateway directly with the Anthropic SDK.

Basic Setup

import anthropic

client = anthropic.Anthropic(
    api_key="sk-air-your-key",
    base_url="https://nexusflow.hk",
)

message = client.messages.create(
    model="qwen3-max",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}]
)
print(message.content[0].text)

Streaming

with client.messages.stream(
    model="qwen3-max",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
) as stream:
    for text in stream.text_stream:
        print(text, end="")

Responses API

Compared with Chat Completions, the Responses API offers more powerful capabilities: built-in tools like web search, web extraction, and code interpreter; and it simplifies multi-turn context management via previous_response_id, with no need to manually build the full message history. Call it via the OpenAI SDK's client.responses.create().

Basic Usage

from openai import OpenAI

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

# Basic usage
response = client.responses.create(
    model="qwen3.7-plus",
    input="Hello!"
)
print(response.output_text)

Built-in Tools

# Using built-in tools
response = client.responses.create(
    model="qwen3.7-plus",
    input="Search today's news for me",
    tools=[
        {"type": "web_search"},
        {"type": "code_interpreter"},
        {"type": "web_extractor"},
    ],
)
print(response.output_text)

Multi-turn Conversation

# Multi-turn conversation — link context via previous_response_id
response1 = client.responses.create(
    model="qwen3.7-plus",
    input="My name is Zhang San"
)

response2 = client.responses.create(
    model="qwen3.7-plus",
    input="Do you still remember my name?",
    previous_response_id=response1.id
)
print(response2.output_text)

Choosing a Protocol

1.If you use models like DeepSeek, Qwen, or GLM, the OpenAI Chat protocol is recommended for the best compatibility.
2.If you already use the Anthropic SDK, prefer /v1/messages to reduce SDK migration cost.
3.If you need built-in tools (web search, code interpreter) or previous_response_id multi-turn context, use /v1/responses.
4.Check supported_protocols on the model detail page to confirm which protocols the model currently exposes.

Related Docs