Afri Nexus AIDocumentation
Afri Nexus AI · Documentation

Operation manual

Everything you need to call text, image and video models with one key: setup, endpoints, per-provider reference, billing and troubleshooting.

Last updated: 2026-10-27 · Model Square · API Keys · Playground

Overview

Afri Nexus AI gives you one API key and one prepaid balance for text, image and video models from OpenAI, Anthropic, Google, DeepSeek, Zhipu AI, Moonshot, MiniMax, Alibaba, xAI, ByteDance and Kuaishou. The API follows the OpenAI format, so the official OpenAI SDKs and any tool that accepts a custom base URL work unchanged. Claude models additionally accept Anthropic’s native Messages API.

Base URLhttps://api.afri-nexus.io/v1
AuthenticationAuthorization: Bearer sk-…
Consoleafri-nexus.io/dashboard
Live pricesModel Square
Your requestsUsage logs
Try a model in the browserPlayground

This manual covers the whole journey: creating a key, calling chat, image and video models, the specifics of each provider’s models (with links to the provider’s own manual), billing, and troubleshooting. https://afri-nexus.io/v1 is accepted as a base URL too; https://api.afri-nexus.io/v1 is the recommended one.

Quick start

  1. Create an account. Sign up with your e-mail address, then sign in to the console.
  2. Add credit. Open Wallet → Top-up. Your balance is shown in US dollars; redeem codes are entered on the same page.
  3. Create an API key. Go to API Keys → Create API Key. Give it a name and, most importantly, choose its group: the group decides which model family the key can call (see Key groups). You can also set a spending limit, an expiry date and IP or model restrictions. Copy the key (it starts with sk-) and keep it secret.
  4. Pick a model. The Model Square lists every live model with its price; use the model ID exactly as written.
  5. Send a request. The example below calls Claude Sonnet 5.5 with a key from the claude-special group.
curl https://api.afri-nexus.io/v1/chat/completions \
  -H "Authorization: Bearer $AFRI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "messages": [
      {"role": "user", "content": "Explain how a mobile money payment API works, in three short sentences."}
    ]
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://api.afri-nexus.io/v1",
    api_key="sk-...",
)

response = client.chat.completions.create(
    model="claude-sonnet-5-5",
    messages=[{"role": "user", "content": "Explain how a mobile money payment API works, in three short sentences."}],
)
print(response.choices[0].message.content)
print(response.usage)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.afri-nexus.io/v1",
  apiKey: process.env.AFRI_API_KEY,
});

const response = await client.chat.completions.create({
  model: "claude-sonnet-5-5",
  messages: [{ role: "user", content: "Explain how a mobile money payment API works, in three short sentences." }],
});
console.log(response.choices[0].message.content);
console.log(response.usage);
A key belongs to exactly one group. A key created in the Default group cannot call any model. To use two model families (for example Claude and GPT Image), create one key per group. The groups are listed in the next section.

Key groups and models

Each group corresponds to one provider line and one discount level, already built into the prices shown in the Model Square. When you create a key you pick its group in the Group field; the API Keys table shows the group of every existing key, and GET /v1/models with that key returns exactly the models it can call.

GroupWhat it unlocksModels
claude-officialClaude official stable · 70% of list price · channel 15claude-fable-5-1-official claude-fable-5-official claude-haiku-5-5-official claude-opus-4-8-official claude-opus-5-5-official claude-opus-5-official claude-sonnet-5-5-official claude-sonnet-5-official
claude-specialClaude · 29% of list price · channel 10claude-opus-4-8 claude-opus-5 claude-opus-5-5 claude-sonnet-5 claude-sonnet-5-5
deepseekDeepSeek · 79% of list price · channel 3deepseek-v4.1-flash
geminiGemini · 19% of list price · channel 13gemini-3.7-flash gemini-3.8-flash gemini-4-argon
glmGLM · 79% of list price · channel 7glm-5.2 glm-5.3 glm-5.3-flash
gptGPT-6 · 25% of list price · channel 12gpt-5.6-sol gpt-5.6-terra gpt-6-astra gpt-6-sol gpt-6.1-sol gpt-6.1-terra
grokGrok · 19% of list price · channel 14grok-4.6 grok-4.7
kimiKimi · 79% of list price · channel 8kimi-k3 kimi-k3.1-pro kimi-k3.1-pro-highspeed
klingKling 3.0 video · 89% of list price · channel 22kling-V3
minimaxMiniMax · 79% of list price · channel 9MiniMax-M2.7 MiniMax-M3 MiniMax-M3.1-Flash-Preview
qwenQwen · 79% of list price · channel 16qwen3.8-27b qwen3.8-flash qwen3.8-max
seedance-fastSeedance video (2.0 Fast) · 75% of list price · channel 28seedance-2.0-fast
seedance-miniSeedance video (2.0 Mini) · 70% of list price · channel 29seedance-2.0-mini
seedance-officialSeedance video (2.0, 2.5) · 85% of list price · channel 24seedance-2.0 seedance-2.5
wanWan 3.0 video · 89% of list price · channel 21wan3.0-video wan3.0-video-prime
image-gpt-imageGPT Image generation · channel 6gpt-image-2 gpt-image-2-2k gpt-image-2-4k gpt-image-2.5-flare gpt-image-2.5-flare-2k gpt-image-2.5-flare-4k
image-nano-bananaNano Banana image generation · channel 5nano-banana-2 nano-banana-2.1 nano-banana-pro

The complete list of model IDs, with the endpoint each one uses:

Model IDProviderTypeKey groupEndpoint
qwen3.8-27bAlibabaTextqwen/v1/chat/completions
qwen3.8-flashAlibabaTextqwen/v1/chat/completions
qwen3.8-maxAlibabaTextqwen/v1/chat/completions
claude-fable-5-1-officialAnthropicTextclaude-official/v1/chat/completions
/v1/messages
claude-fable-5-officialAnthropicTextclaude-official/v1/chat/completions
/v1/messages
claude-haiku-5-5-officialAnthropicTextclaude-official/v1/chat/completions
/v1/messages
claude-opus-4-8AnthropicTextclaude-special/v1/chat/completions
/v1/messages
claude-opus-4-8-officialAnthropicTextclaude-official/v1/chat/completions
/v1/messages
claude-opus-5AnthropicTextclaude-special/v1/chat/completions
/v1/messages
claude-opus-5-5AnthropicTextclaude-special/v1/chat/completions
/v1/messages
claude-opus-5-5-officialAnthropicTextclaude-official/v1/chat/completions
/v1/messages
claude-opus-5-officialAnthropicTextclaude-official/v1/chat/completions
/v1/messages
claude-sonnet-5AnthropicTextclaude-special/v1/chat/completions
/v1/messages
claude-sonnet-5-5AnthropicTextclaude-special/v1/chat/completions
/v1/messages
claude-sonnet-5-5-officialAnthropicTextclaude-official/v1/chat/completions
/v1/messages
claude-sonnet-5-officialAnthropicTextclaude-official/v1/chat/completions
/v1/messages
deepseek-v4.1-flashDeepSeekTextdeepseek/v1/chat/completions
gemini-3.7-flashGoogleTextgemini/v1/chat/completions
gemini-3.8-flashGoogleTextgemini/v1/chat/completions
gemini-4-argonGoogleTextgemini/v1/chat/completions
MiniMax-M2.7MiniMaxTextminimax/v1/chat/completions
MiniMax-M3MiniMaxTextminimax/v1/chat/completions
MiniMax-M3.1-Flash-PreviewMiniMaxTextminimax/v1/chat/completions
kimi-k3MoonshotTextkimi/v1/chat/completions
kimi-k3.1-proMoonshotTextkimi/v1/chat/completions
kimi-k3.1-pro-highspeedMoonshotTextkimi/v1/chat/completions
gpt-5.6-solOpenAITextgpt/v1/chat/completions
gpt-5.6-terraOpenAITextgpt/v1/chat/completions
gpt-6-astraOpenAITextgpt/v1/chat/completions
gpt-6-solOpenAITextgpt/v1/chat/completions
gpt-6.1-solOpenAITextgpt/v1/chat/completions
gpt-6.1-terraOpenAITextgpt/v1/chat/completions
glm-5.2Zhipu AITextglm/v1/chat/completions
glm-5.3Zhipu AITextglm/v1/chat/completions
glm-5.3-flashZhipu AITextglm/v1/chat/completions
grok-4.6xAITextgrok/v1/chat/completions
grok-4.7xAITextgrok/v1/chat/completions
nano-banana-2GoogleImageimage-nano-banana/v1/images/generations
nano-banana-2.1GoogleImageimage-nano-banana/v1/images/generations
nano-banana-proGoogleImageimage-nano-banana/v1/images/generations
gpt-image-2OpenAIImageimage-gpt-image/v1/images/generations
gpt-image-2-2kOpenAIImageimage-gpt-image/v1/images/generations
gpt-image-2-4kOpenAIImageimage-gpt-image/v1/images/generations
gpt-image-2.5-flareOpenAIImageimage-gpt-image/v1/images/generations
gpt-image-2.5-flare-2kOpenAIImageimage-gpt-image/v1/images/generations
gpt-image-2.5-flare-4kOpenAIImageimage-gpt-image/v1/images/generations
wan3.0-videoAlibabaVideowan/v1/videos
wan3.0-video-primeAlibabaVideowan/v1/videos
kling-V3KuaishouVideokling/v1/videos
seedance-2.0VolcengineVideoseedance-official/v1/videos
seedance-2.0-fastVolcengineVideoseedance-fast/v1/videos
seedance-2.0-miniVolcengineVideoseedance-mini/v1/videos
seedance-2.5VolcengineVideoseedance-official/v1/videos
curl https://api.afri-nexus.io/v1/models -H "Authorization: Bearer $AFRI_API_KEY"

Authentication and base URL

Send your key in the Authorization header of every request. Anthropic’s native endpoint also accepts the x-api-key header used by the Anthropic SDKs.

FormatBase URLHeader
OpenAI-compatible (chat, images, video)https://api.afri-nexus.io/v1Authorization: Bearer sk-…
Anthropic Messages API (Claude models)https://api.afri-nexus.io (the SDK appends /v1/messages)x-api-key: sk-… or Authorization: Bearer sk-…, plus anthropic-version: 2023-06-01
  • Keep keys on your server or in a secrets manager; never ship them in a mobile app or a public web page. Create one key per project or environment so you can revoke one without affecting the others.
  • Use the per-key spending limit, expiry date and IP allow-list in the console to limit the damage if a key leaks.
  • A deleted or disabled key is rejected immediately with HTTP 401.

Chat completions (text models)

POST https://api.afri-nexus.io/v1/chat/completions serves every text model: GPT-6, Claude, Gemini, DeepSeek, GLM, Kimi, MiniMax, Qwen and Grok. The request and response are the standard OpenAI Chat Completions objects.

Request fields

FieldMeaning
modelA model ID from the table above, in your key’s group.
messagesThe conversation: system, user and assistant turns. content is a string or an array of parts (text, image_url).
streamtrue to receive the answer token by token (Server-Sent Events). Add stream_options: {"include_usage": true} to get the token count in the last chunk.
max_tokens, temperature, top_p, stopStandard sampling and length controls; supported values depend on the model.
tools, tool_choiceFunction calling in the OpenAI format.
response_format{"type": "json_object"} (or json_schema where the model supports it) for JSON answers.
Provider-specific fieldsreasoning_effort, thinking, enable_thinking, thinking_budget… are forwarded to the provider unchanged. See Reasoning models and the provider reference.

Response

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "claude-sonnet-5-5",
  "choices": [
    {
      "index": 0,
      "message": {"role": "assistant", "content": "..."},
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 27,
    "completion_tokens": 74,
    "total_tokens": 101,
    "prompt_tokens_details": {"cached_tokens": 0},
    "completion_tokens_details": {"reasoning_tokens": 0}
  }
}

usage is what you are billed for: prompt_tokens (input, with cached_tokens billed at the cache-read rate), completion_tokens (output, which includes any reasoning_tokens).

Streaming

curl https://api.afri-nexus.io/v1/chat/completions \
  -H "Authorization: Bearer $AFRI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash",
    "stream": true,
    "stream_options": {"include_usage": true},
    "messages": [{"role": "user", "content": "Explain how a mobile money payment API works, in three short sentences."}]
  }'
stream = client.chat.completions.create(
    model="deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Explain how a mobile money payment API works, in three short sentences."}],
    stream=True,
    stream_options={"include_usage": True},
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
    if chunk.usage:
        print("\n", chunk.usage)
const stream = await client.chat.completions.create({
  model: "deepseek-v4.1-flash",
  messages: [{ role: "user", content: "Explain how a mobile money payment API works, in three short sentences." }],
  stream: true,
  stream_options: { include_usage: true },
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
  if (chunk.usage) console.log("\n", chunk.usage);
}

Each chunk arrives as a data: line containing a chat.completion.chunk object; the stream ends with data: [DONE]. Use streaming for long answers: it shows progress to your users and avoids the 100-second request limit described in Errors and limits.

Images in the prompt (vision)

Multimodal models (for example GPT-6, Claude, Gemini, Kimi K3.1 Pro, Qwen 3.8) accept image parts next to the text. Pass a public HTTPS URL or a data:image/jpeg;base64,… URI.

{
  "model": "gemini-3.8-flash",
  "messages": [
    {
      "role": "user",
      "content": [
        {"type": "text", "text": "What is written on this receipt? Return the total."},
        {"type": "image_url", "image_url": {"url": "https://example.com/receipt.jpg"}}
      ]
    }
  ]
}

Tools (function calling)

{
  "model": "gpt-6-astra",
  "messages": [{"role": "user", "content": "What is the weather in Antananarivo?"}],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get the current weather for a city",
        "parameters": {
          "type": "object",
          "properties": {"city": {"type": "string"}},
          "required": ["city"]
        }
      }
    }
  ],
  "tool_choice": "auto"
}

When the model decides to call a tool, the response contains tool_calls with the function name and JSON arguments; run the function, then send the result back as a tool message and call the API again.

JSON answers

{
  "model": "qwen3.8-max",
  "response_format": {"type": "json_object"},
  "messages": [
    {"role": "system", "content": "Answer with a JSON object: {\"city\": string, \"country\": string}."},
    {"role": "user", "content": "Where is the Avenue of the Baobabs?"}
  ]
}

Reasoning models

Several models think before they answer. Reasoning tokens are billed as output tokens and appear in usage.completion_tokens_details.reasoning_tokens. Each provider controls thinking with its own parameter, which the gateway forwards unchanged:

ModelsParameterBehaviour
GPT-6 (OpenAI)reasoning_effortAs in OpenAI’s reasoning guide.
Claude (Anthropic)thinking, effortAdaptive thinking by default; use the native Messages API for full control.
Gemini (Google)reasoning_effort (low / medium / high)Thinking is on by default and cannot be fully disabled on this generation.
DeepSeek V4.1 Flash—Thinking is on; the reasoning is returned in message.reasoning_content.
GLM 5.x (Zhipu AI)thinking: {"type": "enabled" | "disabled"}glm-5.3-flash thinks by default.
Kimi K3.1 Pro / K3 (Moonshot)reasoning_effort (low / high / max)Default max.
Qwen 3.8 (Alibaba)enable_thinking, thinking_budgetHybrid models think by default; reasoning in reasoning_content.
# Qwen: turn thinking off for a short, cheap answer
client.chat.completions.create(
    model="qwen3.8-flash",
    messages=[{"role": "user", "content": "2 + 2 ?"}],
    extra_body={"enable_thinking": False},
)

# Kimi K3.1 Pro: choose the reasoning depth
client.chat.completions.create(
    model="kimi-k3.1-pro",
    messages=[{"role": "user", "content": "..."}],
    reasoning_effort="low",
)

# DeepSeek: read the reasoning separately from the answer
r = client.chat.completions.create(
    model="deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "..."}],
)
print(r.choices[0].message.reasoning_content)
print(r.choices[0].message.content)

Claude: native Messages API

All claude-* models also accept Anthropic’s own format at POST https://api.afri-nexus.io/v1/messages. Use it when you need Claude-specific features: extended thinking, prompt caching, tool use with Anthropic’s schema, or an existing Anthropic SDK integration (just change base_url and the key).

curl https://api.afri-nexus.io/v1/messages \
  -H "x-api-key: $AFRI_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-5-5",
    "max_tokens": 4096,
    "thinking": {"type": "adaptive"},
    "messages": [{"role": "user", "content": "Explain how a mobile money payment API works, in three short sentences."}]
  }'
import anthropic

client = anthropic.Anthropic(
    base_url="https://api.afri-nexus.io",
    api_key="sk-...",
)

message = client.messages.create(
    model="claude-opus-5-5",
    max_tokens=4096,
    thinking={"type": "adaptive"},
    messages=[{"role": "user", "content": "Explain how a mobile money payment API works, in three short sentences."}],
)
print(next(b.text for b in message.content if b.type == "text"))
print(message.usage)
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://api.afri-nexus.io",
  apiKey: process.env.AFRI_API_KEY,
});

const message = await client.messages.create({
  model: "claude-opus-5-5",
  max_tokens: 4096,
  thinking: { type: "adaptive" },
  messages: [{ role: "user", content: "Explain how a mobile money payment API works, in three short sentences." }],
});
console.log(message.content.find((b) => b.type === "text")?.text);
console.log(message.usage);
  • Thinking. On the current generation (Opus 5.5, Sonnet 5.5, Fable 5.1, Haiku 5.5) thinking is adaptive by default; send "thinking": {"type": "adaptive"} explicitly if you like. The older budget_tokens form is rejected by these models. The depth of reasoning is controlled with output_config.effort as described in Anthropic’s extended-thinking guide.
  • Prompt caching. Mark the stable prefix (system prompt, reference documents, tool definitions) with cache_control; repeated requests are billed at the cache-read rate shown in the Model Square. Cache writes are billed at the cache-write rate.
  • Streaming. "stream": true returns the standard Anthropic event stream (message_start, content_block_delta, …).
  • Two lines, one format. claude-opus-5-5 (group claude-special) and claude-opus-5-5-official (group claude-official) are the same model behind two routes and two prices; pick the line that matches your key.
{
  "model": "claude-sonnet-5-5-official",
  "max_tokens": 2048,
  "system": [
    {
      "type": "text",
      "text": "<your long, stable instructions or reference document>",
      "cache_control": {"type": "ephemeral"}
    }
  ],
  "messages": [{"role": "user", "content": "Summarize the key points."}]
}

Claude Code and Anthropic SDK tools

Any tool built on the Anthropic SDK can point at Afri Nexus through the standard environment variables:

export ANTHROPIC_BASE_URL="https://api.afri-nexus.io"
export ANTHROPIC_API_KEY="sk-..."
export ANTHROPIC_MODEL="claude-opus-5-5"
claude

Image generation

POST https://api.afri-nexus.io/v1/images/generations follows the OpenAI Images API. Two families are available: GPT Image (gpt-image-2, gpt-image-2.5-flare and their -2k / -4k variants, key group image-gpt-image) and Nano Banana (nano-banana-2, nano-banana-pro, Google’s Gemini image models, key group image-nano-banana).

curl https://api.afri-nexus.io/v1/images/generations \
  -H "Authorization: Bearer $AFRI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana-2",
    "prompt": "A market stall in Antananarivo at sunrise, warm light, photo style",
    "size": "1024x1024",
    "response_format": "b64_json"
  }'
import base64

result = client.images.generate(
    model="gpt-image-2",
    prompt="A market stall in Antananarivo at sunrise, warm light, photo style",
    size="1024x1024",
    output_format="png",
    response_format="b64_json",
)
with open("image.png", "wb") as f:
    f.write(base64.b64decode(result.data[0].b64_json))
import fs from "node:fs";

const result = await client.images.generate({
  model: "gpt-image-2",
  prompt: "A market stall in Antananarivo at sunrise, warm light, photo style",
  size: "1024x1024",
  output_format: "png",
  response_format: "b64_json",
});
fs.writeFileSync("image.png", Buffer.from(result.data[0].b64_json, "base64"));
{
  "created": 1760200000,
  "data": [
    {"b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."}
  ]
}

Parameters

FieldMeaning
promptWhat to draw. Nano Banana is strong at legible text and precise layouts; GPT Image at faithful edits and consistent style.
sizeWIDTHxHEIGHT. The size selects the resolution tier that is billed (see below). Omit it or send an aspect ratio such as 16:9 to get the 1K tier.
qualitylow / medium / high / auto; no price difference.
output_formatpng, jpeg (default) or webp.
response_formatSend b64_json to receive the image bytes inline. GPT Image models always return b64_json; Nano Banana returns a temporary URL unless you ask for b64_json. Download or store the image on your side.
nMust be 1 (one image per request).

Resolution tiers

TierAccepted size values
1K1024x1024, 1152x864, 864x1152, 1536x1024, 1024x1536, 1344x768, 768x1344, 1536x656, 1120x896, 896x1120
2K2048x2048, 2048x1536, 1536x2048, 2304x1536, 1536x2304, 2048x1152, 1152x2048, 2304x992, 1920x1536, 1536x1920
4K2880x2880, 3200x2400, 2400x3200, 3456x2304, 2304x3456, 3840x2160, 2160x3840, 3840x1648, 3200x2560, 2560x3200

Images are billed per image at the tier’s price (Model Square → model → Details). The -2k and -4k model names are priced at their tier regardless of the size you send, so pair them with a matching 2K or 4K size. A 1K image usually takes 15–60 seconds; 4K images can take longer, so keep interactive use at 1K and generate large sizes in the background.

Editing an image

POST https://api.afri-nexus.io/v1/images/edits (multipart form: image, prompt, model, optional mask) follows the OpenAI format for the GPT Image and Nano Banana models.

Video generation

Video is asynchronous: you submit a task, poll its status, then download the clip. Video models are split by provider into three key groups: seedance-official (Seedance 2.0, 2.5, 2.0 Fast and 2.0 Mini), wan (Wan 3.0) and kling (Kling 3.0); a key calls only the models of its own group.

1. Submit

curl https://api.afri-nexus.io/v1/videos \
  -H "Authorization: Bearer $AFRI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2.0-fast",
    "prompt": "A fishing boat leaves a Malagasy harbour at dawn, cinematic, slow push-in",
    "seconds": 5,
    "resolution": "480p"
  }'
{
  "id": "task_01HZ...",
  "object": "video",
  "model": "seedance-2.0-fast",
  "status": "queued",
  "progress": 0,
  "created_at": 1760200000
}

2. Poll, then download

curl https://api.afri-nexus.io/v1/videos/TASK_ID \
  -H "Authorization: Bearer $AFRI_API_KEY"

# -> {"id": "TASK_ID", "object": "video", "status": "in_progress", "progress": 40, ...}
# -> {"id": "TASK_ID", "object": "video", "status": "completed", "progress": 100, ...}

curl -L https://api.afri-nexus.io/v1/videos/TASK_ID/content \
  -H "Authorization: Bearer $AFRI_API_KEY" -o video.mp4

Status goes queued → in_progress → completed (or failed, with an error object). Poll every 10–15 seconds; a clip typically takes 1–5 minutes depending on model, duration and resolution.

Request fields

FieldMeaning
modelOne of the video model IDs below.
promptDescription of the clip. Required unless a reference image is given.
seconds (or duration)Clip length in seconds, within the model’s range. Wan 3.0 also accepts -1 to let the model choose.
resolution (or size)Output tier, e.g. 480p, 720p, 1080p, 4k (Wan uses 480P / 720P / 1080P). Always set it: it decides the price.
images (or input_reference)Array of public image URLs used as first frame / reference (image-to-video). Uploaded files are not accepted; host the image and pass its URL.
ratioAspect ratio such as 16:9 or 9:16 (Wan, Kling). For Seedance pass it inside metadata: "metadata": {"ratio": "16:9"}.
generate_audiotrue to render native audio with Kling (billed at the “with audio” rate).
negative_prompt, seed, watermark, metadataOptional provider options, forwarded as-is.

Models

ModelProviderResolutionsDurationBilling
seedance-2.0ByteDance (Volcengine)720p, 1080p, 4k4–15 sper million video tokens (≈ width × height × frames ÷ 1024), cheaper with a reference video
seedance-2.5ByteDance (Volcengine)480p, 720p, 1080p4–30 sper million video tokens
seedance-2.0-fast, seedance-2.0-miniByteDance (Volcengine)480p, 720p4–15 sper million video tokens
wan3.0-video, wan3.0-video-primeAlibaba480P, 720P, 1080P4–30 s, or -1per second (reference input seconds + output seconds)
kling-V3Kuaishou720p, 1080p, 4k4–15 sper second, higher rate with generate_audio

When you submit, the estimated cost is reserved on your balance; when the task completes it is settled on the provider’s reported usage, and a failed task releases the reservation. Live per-second and per-token rates are in the Model Square; the Usage logs show one line at submission and one at settlement.

Image-to-video in Python

import time, requests

API = "https://api.afri-nexus.io/v1"
H = {"Authorization": "Bearer sk-..."}

task = requests.post(f"{API}/videos", headers=H, json={
    "model": "wan3.0-video",
    "prompt": "A fishing boat leaves a Malagasy harbour at dawn, cinematic, slow push-in",
    "images": ["https://example.com/first-frame.jpg"],
    "seconds": 5,
    "resolution": "720P",
}).json()

while True:
    status = requests.get(f"{API}/videos/{task['id']}", headers=H).json()
    if status["status"] in ("completed", "failed"):
        break
    time.sleep(10)

if status["status"] == "completed":
    mp4 = requests.get(f"{API}/videos/{task['id']}/content", headers=H)
    open("video.mp4", "wb").write(mp4.content)
else:
    print(status.get("error"))

Kling with native audio

{
  "model": "kling-V3",
  "prompt": "...",
  "seconds": 5,
  "resolution": "1080p",
  "ratio": "16:9",
  "generate_audio": true
}

Model reference by provider

Afri Nexus relays each request to the model’s provider, so the provider’s own manual is the reference for prompt formats, parameters, context windows and behaviour. The cards below list what we serve from each provider, what to keep in mind on our gateway, and the official documentation to read. Prices: the Model Square cards show the provider’s official list price; open a model’s Details to see the Afri Nexus price and the discount.

OpenAI

GPT-6 family for chat, coding, tool use and structured output, plus the GPT Image models. Chat models use the OpenAI Chat Completions format unchanged; reasoning_effort is forwarded as described in OpenAI’s reasoning guide. As on OpenAI’s own list, prices are tiered by prompt length (≤ 272K tokens vs. above).

Models on Afri Nexus

  • gpt-5.6-solTextgpt
  • gpt-5.6-terraTextgpt
  • gpt-6-astraTextgpt
  • gpt-6-solTextgpt
  • gpt-6.1-solTextgpt
  • gpt-6.1-terraTextgpt
  • gpt-image-2Imageimage-gpt-image
  • gpt-image-2-2kImageimage-gpt-image
  • gpt-image-2-4kImageimage-gpt-image
  • gpt-image-2.5-flareImageimage-gpt-image
  • gpt-image-2.5-flare-2kImageimage-gpt-image
  • gpt-image-2.5-flare-4kImageimage-gpt-image

Official documentation

Anthropic

Claude models are offered in two lines: the plain names (key group claude-special) and the -official names (key group claude-official, the “official stable” line routed through Anthropic’s own infrastructure). Both accept the OpenAI-compatible /v1/chat/completions and Anthropic’s native /v1/messages. Thinking is adaptive by default on the current generation; prompt caching with cache_control is billed at the cache read / write rates shown in the Model Square. Claude Haiku 5.5 is available in the official line only.

Models on Afri Nexus

  • claude-fable-5-1-officialTextclaude-official
  • claude-fable-5-officialTextclaude-official
  • claude-haiku-5-5-officialTextclaude-official
  • claude-opus-4-8Textclaude-special
  • claude-opus-4-8-officialTextclaude-official
  • claude-opus-5Textclaude-special
  • claude-opus-5-5Textclaude-special
  • claude-opus-5-5-officialTextclaude-official
  • claude-opus-5-officialTextclaude-official
  • claude-sonnet-5Textclaude-special
  • claude-sonnet-5-5Textclaude-special
  • claude-sonnet-5-5-officialTextclaude-official
  • claude-sonnet-5-officialTextclaude-official

Official documentation

Google

Gemini 4 Argon and the faster Gemini Flash models for multimodal chat (thinking is on by default and billed as output tokens), plus the Nano Banana image models (Gemini image generation). Use reasoning_effort as documented in Google’s OpenAI-compatibility guide. Image sizes follow the 1K / 2K / 4K tiers listed in the image section.

Models on Afri Nexus

  • gemini-3.7-flashTextgemini
  • gemini-3.8-flashTextgemini
  • gemini-4-argonTextgemini
  • nano-banana-2Imageimage-nano-banana
  • nano-banana-2.1Imageimage-nano-banana
  • nano-banana-proImageimage-nano-banana

Official documentation

DeepSeek

DeepSeek V4.1 Flash, a high-value reasoning and coding model. On Afri Nexus it runs in thinking mode: the reasoning is returned in reasoning_content and counted as output tokens. Request format and parameters follow DeepSeek’s OpenAI-compatible API.

Models on Afri Nexus

  • deepseek-v4.1-flashTextdeepseek

Official documentation

Zhipu AI

GLM 5.x models from Z.ai: bilingual general models with solid agent and coding skills. glm-5.3-flash thinks by default (reasoning tokens are billed as output). Thinking is controlled with the thinking parameter described in Z.ai’s thinking-mode guide.

Models on Afri Nexus

  • glm-5.2Textglm
  • glm-5.3Textglm
  • glm-5.3-flashTextglm

Official documentation

Moonshot

Kimi K3.1 Pro (flagship, 1M-token context, vision), Kimi K3.1 Pro Highspeed (same model, 2–3× faster output) and Kimi K3. Thinking is on by default; its depth is set with reasoning_effort (low / high / max). Requests follow the OpenAI Chat Completions format.

Models on Afri Nexus

  • kimi-k3Textkimi
  • kimi-k3.1-proTextkimi
  • kimi-k3.1-pro-highspeedTextkimi

Official documentation

MiniMax

MiniMax M3 series text models (M3.1 Flash Preview, M3, M2.7). Requests follow MiniMax’s OpenAI-compatible API; as on MiniMax’s own list, prices step up for very long inputs (above 512K tokens).

Models on Afri Nexus

  • MiniMax-M2.7Textminimax
  • MiniMax-M3Textminimax
  • MiniMax-M3.1-Flash-PreviewTextminimax

Official documentation

Alibaba

Qwen 3.8 text models (Max, 27B, Flash) and the Wan 3.0 video models. Qwen hybrid models think by default; disable it with enable_thinking: false (and cap it with thinking_budget) as in Alibaba Cloud Model Studio’s deep-thinking guide; the reasoning arrives in reasoning_content. Wan 3.0 is billed per second of video (input reference seconds plus output seconds) at 480P / 720P / 1080P.

Models on Afri Nexus

  • qwen3.8-27bTextqwen
  • qwen3.8-flashTextqwen
  • qwen3.8-maxTextqwen
  • wan3.0-videoVideowan
  • wan3.0-video-primeVideowan

Official documentation

xAI

Grok 4.7 and Grok 4.6 chat models in the OpenAI Chat Completions format. As on xAI’s list, the price doubles for prompts of 200K tokens or more.

Models on Afri Nexus

  • grok-4.6Textgrok
  • grok-4.7Textgrok

Official documentation

Volcengine

ByteDance’s Seedance video models (served through Volcengine / BytePlus ModelArk): Seedance 2.0 (720p / 1080p / 4K, 4–15 s), Seedance 2.5 (480p–1080p, 4–30 s), Seedance 2.0 Fast and Mini (480p / 720p). Billing is per million video tokens, where tokens ≈ width × height × frames ÷ 1024, with a lower rate when a reference video is supplied.

Models on Afri Nexus

  • seedance-2.0Videoseedance-official
  • seedance-2.0-fastVideoseedance-fast
  • seedance-2.0-miniVideoseedance-mini
  • seedance-2.5Videoseedance-official

Official documentation

Kuaishou

Kling 3.0 (kling-V3) video generation: 720p / 1080p / 4K, 4–15 seconds, optional native audio (generate_audio: true, billed at the “with audio” rate). Billed per second of output video.

Models on Afri Nexus

  • kling-V3Videokling

Official documentation

SDKs, coding assistants and no-code tools

Official SDKs

  • OpenAI SDKs (Python, Node.js, Go, Java, .NET, PHP…): set the base URL to https://api.afri-nexus.io/v1 and the API key to your Afri key. Everything in Chat completions and Image generation works through them.
  • Anthropic SDKs (Python, TypeScript, Java, Go…): set base_url to https://api.afri-nexus.io; see Claude: native Messages API.
  • LangChain, LlamaIndex, Vercel AI SDK and similar frameworks: use their OpenAI-compatible provider with the same base URL and key.

Coding assistants

Any editor or agent that accepts a custom OpenAI-compatible base URL runs on your Afri balance: Cursor, Cline, Roo Code, Continue, Zed, opencode, aider, Kilo Code… In the tool’s provider settings choose “OpenAI compatible”, enter https://api.afri-nexus.io/v1, your key, and a model ID from your key’s group (for example claude-sonnet-5-5, gpt-6-astra, kimi-k3.1-pro). Tools built on the Anthropic SDK, such as Claude Code, use the environment variables shown in the Claude section.

No-code automation (n8n, Make, Zapier)

Use an HTTP request node with the JSON body below, or the tool’s OpenAI node with a custom base URL. Plain JSON in, plain JSON out:

POST https://api.afri-nexus.io/v1/chat/completions
Authorization: Bearer sk-...
Content-Type: application/json

{
  "model": "gemini-3.8-flash",
  "messages": [
    {"role": "system", "content": "Reply in the customer's language."},
    {"role": "user", "content": "{{ $json.message }}"}
  ]
}

Desktop chat clients

The API Keys page offers one-click configuration for chat clients such as Cherry Studio and others; the Playground lets you try any model in the browser without writing code.

Billing and usage

  • Prepaid, pay as you go. You top up a balance in US dollars and every request is deducted from it; there is no subscription. Top-ups and redeem codes are in Wallet.
  • Prices. The Model Square (no account needed) shows, for each model, the Afri Nexus price next to the provider’s official list price and the discount of the model’s key group; Details lists every price tier, endpoint and a ready-to-run request. The group descriptions (for example “Claude · 29% of list price”) summarise the same discount.
  • Text models are billed per token: input tokens, output tokens (including reasoning tokens) and, where the provider supports caching, cached input at the cache-read rate and cache writes at the cache-write rate. Token counts come from the provider’s response and may include provider-side system tokens, which show up as (mostly cached) input tokens in your logs. Some providers price long prompts higher (OpenAI above 272K tokens, xAI from 200K, MiniMax above 512K, Haiku 5.5 above 100K), exactly as on their own lists.
  • Image models are billed per image, by resolution tier (1K / 2K / 4K).
  • Video models are billed per second (Wan, Kling) or per million video tokens (Seedance), with a reservation at submission and a settlement at completion.
  • Usage logs. Usage logs list every request with its model, tokens and cost; filter by key to attribute spend to a project. The dashboard charts spend over time.
  • Per-key limits. A key can carry its own spending limit and expiry date; when the limit or your balance is exhausted, requests fail with HTTP 403 until you top up.

Errors and limits

Errors use the OpenAI error envelope:

{
  "error": {
    "message": "...",
    "type": "...",
    "code": "..."
  }
}
HTTP statusMeaningWhat to do
400Invalid request: unknown field, wrong type, value outside the model’s limits (e.g. video duration, image size, n > 1).Check the message; compare with the provider’s manual.
401Missing, malformed, disabled or deleted key.Check the Authorization header and the key in the console.
403Insufficient balance, key spending limit reached, key expired, IP or model not allowed for this key.Top up or adjust the key’s settings.
404Unknown endpoint or task ID.Check the path (/v1/…) and the ID.
429Too many requests, at Afri Nexus or at the provider.Retry with exponential back-off.
503 / 502 / 500“No available channel for model … under group …”: the model is not in your key’s group, or the provider is temporarily unavailable.Check the model ID and your key’s group; otherwise retry later.
524The request took longer than 100 seconds and the connection was closed by our edge network.Use stream: true for long text generations; use the asynchronous video flow; keep images at 1K for interactive use.

Limits

  • 100 seconds per non-streaming HTTP request. Streaming responses are not affected as long as data keeps flowing.
  • Images: one image per request (n = 1).
  • Video: durations and resolutions per model as listed in Video generation; reference images and videos must be public URLs.
  • Context windows and output limits are the provider’s; see the provider reference.

FAQ and support

Will my existing OpenAI code work?

Yes. Set the base URL to https://api.afri-nexus.io/v1, use your Afri key and pick a model from your key’s group. Official OpenAI SDKs and most frameworks that accept a custom base URL work unchanged.

Why does my key get “no available channel for model …”?

The model is not in the key’s group. Check the group in the API Keys table against the groups table, and create a key in the right group if needed. Keys in the Default group cannot call any model.

Can one key use Claude and GPT Image?

No: one key, one group. Create one key per model family; they share the same balance.

How are prices set?

Each group buys its model family at a fixed percentage of the provider’s official list price (the percentage is in the group’s description). The Model Square card shows the official price; the Details drawer shows the Afri Nexus price and the discount.

Which models can I use?

Everything in the models table: GPT-6, Claude, Gemini, DeepSeek, GLM, Kimi, MiniMax, Qwen and Grok for text; GPT Image and Nano Banana for images; Seedance, Wan 3.0 and Kling 3.0 for video. The Model Square always lists what is live.

How do I top up and get help?

Top-up options are shown in Wallet. For help, message us on our Facebook page; we reply in English or French.

Are you affiliated with the model providers?

No. Afri Nexus AI is an independent gateway. Model names and brands belong to their respective owners, and each provider’s usage policies apply to your requests.