nexusflow
Online
Feature

Multi-Protocol Support

Connect to the same gateway using familiar SDKs - unified authentication, billing, and monitoring

NexusFlow currently provides three public protocols: OpenAI, Anthropic Messages, and Gemini-compatible GenerateContent. These protocols connect through a compatibility layer to the same model routing, billing, and monitoring pipeline, allowing you to continue using familiar SDKs while keeping provider differences from leaking into your business logic. Gemini-compatible means request/response format compatibility - it does not mean the platform hosts native Google Gemini models.

Supported Protocols

ProtocolEndpoint PrefixCorresponding SDKPrimary Use
OpenAI Chat Completions/v1/chat/completionsOpenAI SDKChat, Tool Calling
OpenAI Image Generations/v1/images/generationsOpenAI SDKImage Generation
OpenAI Embeddings/v1/embeddingsOpenAI SDKText Embeddings
Anthropic Messages/v1/messagesAnthropic SDKChat, Tool Calling
Gemini-compatible GenerateContent/v1beta/models/{model}:generateContentGoogle GenAI SDK / HTTPChat format compatibility

Not all models support all protocols. The model detail page will display the model's current supported_protocols.

Protocol Boundaries

NexusFlow's current public API only lists directly callable compatible endpoints. The model detail page will show each model's actual supported_protocols.

Protocol / InterfaceEndpointCurrent StatusDescription
OpenAI Chat Completions/v1/chat/completionsAvailableDefault recommended endpoint for text, reasoning, multimodal, and coding models.
Anthropic Messages/v1/messagesAvailableCompatible with Anthropic SDK and Messages request/streaming event format.
Gemini-compatible GenerateContent/v1beta/models/{model}:generateContentAvailableCompatible with Google GenAI / Gemini GenerateContent request format.
OpenAI Image Generations/v1/images/generationsAvailableSynchronous compatible endpoint for image generation; complex image/video tasks can also use /v1/tasks.
OpenAI Embeddings/v1/embeddingsAvailableText embedding model endpoint.
NexusFlow Tasks/v1/tasksAvailableUnified async task endpoint for images and videos.

Reference: Alibaba Cloud Bailian Qwen API Reference.

OpenAI Protocol

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

Basic Configuration

from openai import OpenAI

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

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

Streaming Output

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 supporting 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 Embeddings

Models supporting the openai:embeddings protocol can convert text to vector representations, useful for semantic search, clustering, RAG, and other scenarios.

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 use the Anthropic SDK to connect to NexusFlow's unified model gateway.

Basic Configuration

import anthropic

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

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

Streaming Output

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="")

Gemini-compatible Protocol

Provides a Google GenAI-style /v1beta/models/{model}:generateContent compatible endpoint, suitable for scenarios where you need to continue using the Gemini SDK. The model in the path is a NexusFlow model ID, for example qwen-turbo, not a native Google Gemini model name. Currently focused on generateContent and streamGenerateContent.

from google import genai
from google.genai import types

client = genai.Client(
    api_key="sk-air-your-key",
    http_options=types.HttpOptions(
        api_version="v1beta",
        base_url="https://nexusflow.vip",
    ),
)

response = client.models.generate_content(
    model="qwen-turbo",
    contents="Hello!",
)
print(response.text)

Protocol Selection Tips

1.If you use DeepSeek, Qwen, GLM, or other domestic models, we recommend the OpenAI protocol for best compatibility.
2.If you're already using the Anthropic SDK, prefer /v1/messages to reduce SDK migration cost.
3.If your application is based on the Google GenAI SDK, you can use /v1beta/models/{model}:generateContent, but fill in NexusFlow model IDs for model.
4.Check the model detail page's supported_protocols to confirm which protocols a model currently supports.

Related Docs