Developer Integration Guide

AINode Usage Guide & API Documentation

Unified access to premier Large Language Models, image generation, audio, and embeddings. 3-step quick setup, supporting any OpenAI SDK and popular client apps (NextChat, ChatBox, Cherry Studio, Cursor, etc.).

Gateway Specs & Authentication

Fully compatible with standard OpenAI protocols. Seamlessly switch endpoints without changing business logic.

API Base URL

https://api.ainode.run/v1

The API Base URL configured in OpenAI SDK and third-party client apps.

API Key CredentialManage

sk-ainode-••••••••••••••••

Created in the user dashboard, starting with sk-ainode-.

Authorization Header

Bearer sk-ainode-xxxx

Standard HTTP Bearer format placed in request headers.

Protocol Standard

OpenAI-Compatible & Anthropic-Compatible

Supports /v1/chat/completions, /v1/models, /v1/embeddings, etc.

3 Steps to Get Started

Connect your applications or desktop clients to world-class AI models in minutes.

01

1. Register & Fund Your Account

Sign up and receive initial trial credits. Visit Plans & Subscriptions to choose pay-as-you-go topup packs or recurring subscriptions.

Go to Plans
02

2. Create Your API Key

Generate your unique API Key (sk-ainode-...) in the user dashboard with one click. Supports instant rotation and toggling.

Create API Key
03

3. Configure Clients & Start Calling

Set Base URL to the gateway address, enter your API Key, and select target models (e.g. gpt-5.5, claude-sonnet-5) to start calling!

View Model Plaza

Popular Client Applications Setup

Out-of-the-box support for nearly all popular AI desktop apps and developer IDE plugins.

NextChat / ChatBox

Select OpenAI provider in settings, enter the endpoint address and API Key to start chatting immediately.

Endpoint URL:https://api.ainode.run
API Key:sk-ainode-...
Recommended Models:gpt-5.5, claude-sonnet-5

Cherry Studio

Add an OpenAI-compatible provider in settings, enter Base URL and key. Supports automatic model list synchronization.

Endpoint URL:https://api.ainode.run/v1
API Key:sk-ainode-...
Model Sync:Click 'Manage' to fetch all models

Cursor / VS Code (Cline / Continue)

Choose OpenAI-compatible in AI settings, override Base URL and enter your API Key for intelligent autocomplete and Agent coding.

Provider Type:OpenAI Compatible
Base URL:https://api.ainode.run/v1
API Key:sk-ainode-...

Claude Code CLI

Native Anthropic protocol support. Set environment variables in your terminal to launch directly:

export ANTHROPIC_BASE_URL="https://api.ainode.run"
export ANTHROPIC_API_KEY="sk-ainode-..."

Dify / FastGPT Knowledge Base

Add an OpenAI API-compatible model provider, fill in the API domain and key to quickly build enterprise RAG applications.

Provider Type:OpenAI API-compatible
API Endpoint:https://api.ainode.run/v1
API Key:sk-ainode-...

Developer SDKs & Code Integration

Works out of the box with standard OpenAI SDKs and HTTP clients across multiple programming languages.

curl https://api.ainode.run/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-ainode-your-api-key" \
  -d '{
    "model": "gpt-5.5",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello AINode!"}
    ],
    "stream": false
  }'
Run in any terminal to test connectivity and model output immediately

Supported Modalities & Endpoints

Comprehensive multimodal capabilities covering text, reasoning, image creation, video generation, embeddings, and audio.

Chat & Text Completions

/v1/chat/completions

Supports /v1/chat/completions across GPT, Claude, DeepSeek, Qwen models with SSE streaming and system prompt injection.

Deep Reasoning & Thinking Chains

DeepSeek V4 Pro / Claude Opus 4.8

Supports DeepSeek V4 Pro, o1, o3-mini with native reasoning_content output for complex reasoning and mathematics.

Image Generation & Creation

/v1/images/generations

Supports /v1/images/generations for DALL-E 3, FLUX, Midjourney with per-request pricing for high-res images.

Embeddings & Reranking

/v1/embeddings

Supports /v1/embeddings and /v1/rerank with text-embedding-3, BGE, and Jina models for private knowledge bases and RAG.

Speech-to-Text & Text-to-Speech

/v1/audio/*

Supports /v1/audio/transcriptions (Whisper) and /v1/audio/speech (TTS) for accurate transcription and realistic speech synthesis.

AI Video Generation

/v1/videos

Supports standard async /v1/videos across Sora 2, Google Veo 3.1, Kling 3.0, Doubao Seedance, Alibaba Wan, Vidu, and MiniMax H3 with per-second settlement.

Billing Engine & Wallet Rules

A transparent, atomic billing engine ensuring zero overdraft, zero missing charges, and zero resource waste.

Dual-Balance Architecture (Grant + Cash)

The system manages two balances: promotional grants (with expiration) and cash topups (never expires). Spending automatically deducts grants first, then falls back to cash.

Model Multipliers & Discount Ratios

Actual Cost = Official Base Rate × Model Multiplier. Multipliers below 1.0x represent discounts (e.g. 0.8x is 20% off). Special routes bill at published plaza rates.

Prompt Caching Discounts

Models supporting Prompt Caching receive substantial discounts (typically 10% to 50% of the normal prompt rate) on cache hits, slashing multi-turn chat costs.

Automatic Disconnect Stop-Loss

When a client disconnects or aborts a streaming request, the gateway immediately cancels the upstream call and bills only for generated tokens.

Frequently Asked Questions & Troubleshooting

Solutions for common integration questions to help you diagnose and resolve issues quickly.

Q: API call returns 401 Unauthorized?

Usually caused by a missing, malformed, or inactive API Key. Ensure your header is formatted as 'Authorization: Bearer sk-ainode-...' with no trailing whitespace.

Q: API call returns 402 Payment Required or insufficient quota?

Both your grant credits and cash balance have been exhausted. Please visit Plans & Subscriptions to recharge your balance; funds are credited immediately.

Q: API call returns 404 Model Not Found?

The requested model name does not exist or has no active upstream channel. Check Model Plaza for the exact model identifier (e.g. gpt-5.5, claude-sonnet-5, deepseek-v4-pro).

Q: Encountering 429 Rate Limit Exceeded error?

Your request rate exceeded the RPM or TPM limit. Implement exponential backoff in your client or contact support to request higher concurrency quotas.

Q: Responses are slow or timing out?

Large models (especially reasoning models) take time. Enable streaming (stream=true) for millisecond first-token latency. The gateway also includes automatic channel failover.

Ready to Harness Top-Tier AI Models?

Connect to Claude Sonnet 5, GPT-5.5, DeepSeek V4 Pro, and over 100+ state-of-the-art models with just a few lines of code.