nexusflow
Online
Gemini Compatible Layer

Gemini-Compatible API

Provides a compatible endpoint for the Google Gemini GenerateContent request/response format, suitable for users who already have a Gemini SDK or HTTP integration and want to migrate to NexusFlow. This is not Google's native Gemini model hosting; the model in the path must be a NexusFlow model ID, e.g. qwen-turbo.

Endpoints

POSThttps://nexusflow.vip/v1beta/models/{model}:generateContentSynchronous generation
POSThttps://nexusflow.vip/v1beta/models/{model}:streamGenerateContentStreaming generation

Request Parameters

ParametersRequiredDescription
model*Path parameter; must use a NexusFlow model ID, e.g. qwen-turbo; do not use Google's native model name
key*API Key; recommended to pass in the query string: ?key=sk-air-...; also compatible with Authorization: Bearer
contents*Conversation content array; each item includes role (user/model) and parts (text array)
generationConfig.temperature-Sampling temperature [0, 2], default 1.0
generationConfig.maxOutputTokens-Maximum output token count
generationConfig.topP-Top-P sampling
generationConfig.topK-Top-K sampling
generationConfig.stopSequences-Stop sequence array
tools-Tool/function definition array (Function Calling)

Request Examples

curl "https://nexusflow.vip/v1beta/models/qwen-turbo:generateContent?key=$API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"role": "user", "parts": [{"text": "Explain what machine learning is"}]}
    ]
  }'

Response Format

{
  "candidates": [{
    "content": {
      "parts": [{"text": "Machine learning is a branch of artificial intelligence..."}],
      "role": "model"
    },
    "finishReason": "STOP"
  }],
  "usageMetadata": {
    "promptTokenCount": 12,
    "candidatesTokenCount": 256,
    "totalTokenCount": 268
  }
}
Note: The Gemini Compatible Layer automatically transforms requests into the platform's internal format, routes them to the corresponding model, and then converts the response back to Gemini format. This is not Google's official Gemini backend, and we do not guarantee that Google's native model names will work; model capabilities are based on the NexusFlow model list. If you don't have a Gemini SDK dependency, we recommend using /v1/chat/completions (OpenAI format) for more complete feature support.
Chat Completions
OpenAI-format conversation interface
Multi-Protocol Support
View all compatible protocols
Full Pricing
View pricing for all models