NeuralSpace API

Language: Русский · English · العربية · 简体中文

Documentation for developers and AI agents. This page is available without authentication and is intended, among other things, to be read automatically.

Base URL: https://neuralspace.pro. You pay with account balance tokens (1 token = 1 ₽), no subscriptions or foreign cards required. The text and chat endpoints are compatible with the Anthropic and OpenAI SDKs — just change base_url and the key.

Authentication

Create an API key in your account: https://neuralspace.pro/api-keys. The key looks like nsk-... and is shown only once. Pass it in the header:

x-api-key: nsk-your_key

The Authorization: Bearer nsk-... header is also accepted (for OpenAI-compatible clients).

MCP server — connect NeuralSpace to your AI agent

Everything this API can do (image/video/music generation, chatting with LLMs, speech synthesis and recognition, balance, prices) is also available as an MCP server (Model Context Protocol) — you can connect it to Claude Code, Claude Desktop, Cursor and any other MCP client, and your AI agent will generate content itself on behalf of your account.

Endpoint (Streamable HTTP, sessionless): https://neuralspace.pro/mcp. Authorization — the same nsk-... key in the Authorization: Bearer or x-api-key header.

# Claude Code
claude mcp add --transport http neuralspace https://neuralspace.pro/mcp \
  --header "Authorization: Bearer nsk-your_key"
// Cursor / Claude Desktop and other streamable-http clients
{
  "mcpServers": {
    "neuralspace": {
      "type": "http",
      "url": "https://neuralspace.pro/mcp",
      "headers": { "Authorization": "Bearer nsk-your_key" }
    }
  }
}
// Clients that only speak stdio — via the mcp-remote bridge
{
  "mcpServers": {
    "neuralspace": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://neuralspace.pro/mcp",
               "--header", "Authorization: Bearer nsk-your_key"]
    }
  }
}

MCP server tools: list_models (models and live prices), get_balance (balance), chat (LLM), generate_image, generate_video + check_video, generate_music + check_music, text_to_speech, transcribe_audio. Billing and refunds work exactly as for direct API calls; successful generations appear as cards in your account. For synchronous image generation (up to ~2 minutes) increase the MCP tool timeout in your client if it is lower.

GET /v1/balance and GET /v1/models — service endpoints

GET /v1/balance — the current token balance of the key owner: { "balance": N, "currency": "tokens" }. GET /v1/models — a machine-readable list of all models with live prices (the JSON version of this page). Both require a key.

POST /v1/messages — text models (Anthropic format)

Compatible with the Anthropic Messages API. Models: claude-haiku-4-5, claude-sonnet-4-6, claude-sonnet-5, claude-opus-4-6, claude-opus-4-7, claude-opus-4-8, claude-opus-5, claude-fable-5.

Body fields: model, messages (array of {role, content}, role — user/assistant), max_tokens (1—32000), optional system.

curl https://neuralspace.pro/v1/messages \
  -H "x-api-key: nsk-your_key" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Via the Anthropic SDK (Python): Anthropic(base_url="https://neuralspace.pro", api_key="nsk-...").

POST /v1/chat/completions — chat models (OpenAI format)

Compatible with the OpenAI Chat Completions API. Models: gpt-5-6, gpt-5-6-balanced, gpt-5-6-fast, gpt-5-mini, gpt-5-4-mini, grok-4-6, grok-4-5, grok-4-3, kimi-k2.6, kimi-k3, glm-5.2, deepseek-v4-flash, deepseek-v4-pro.

Body fields: model, messages (role — system/user/assistant), max_tokens or max_completion_tokens, optional reasoning_effort (for gpt-5-6 / gpt-5-6-balanced / gpt-5-6-fast, grok-4-5).

curl https://neuralspace.pro/v1/chat/completions \
  -H "Authorization: Bearer nsk-your_key" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-5-6-balanced",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Via the OpenAI SDK: OpenAI(base_url="https://neuralspace.pro/v1", api_key="nsk-...").

Realtime voice

Grok Think Fast is available over WebSocket for native speech-to-speech. Sessions are limited to 120 minutes. Billing uses the actual duration of input and output audio; the exact amount is in the price table above.

const ws = new WebSocket(
  "wss://neuralspace.pro/v1/realtime?model=grok-voice-think-fast-2.0&lang=en",
  { headers: { Authorization: "Bearer nsk-your_key" } }
);

POST /v1/images/generations — image generation

Synchronous: the response contains a ready URL. Tokens are charged only on success. Models: nano-banana, nano-banana-pro, nano-banana-2, nano-banana-2-lite, flux-2-pro, gpt-image-15, gpt-image-2, gpt-image-2-pro, seedream-45, seedream-5-lite, seedream-5-pro, grok-image, grok-imagine-image-2, ns-image, z-image, ideogram, midjourney.

Body fields: model, prompt (up to 5000 characters), optional aspect_ratio (gpt-image-2-pro: 1:1/3:2/2:3), resolution (1K/2K/4K — where supported), output_format (jpeg/png — nano-banana-pro; jpeg/png/webp — gpt-image-2-pro), quality (medium/high — gpt-image-15; low/medium/high — gpt-image-2-pro), mode (relaxed/fast/turbo — midjourney), image_urls (array — enables edit / image-to-image mode).

curl https://neuralspace.pro/v1/images/generations \
  -H "x-api-key: nsk-your_key" \
  -H "content-type: application/json" \
  -d '{
    "model": "nano-banana-pro",
    "prompt": "A cat in space, digital illustration",
    "resolution": "2K"
  }'

Response: { "data": [{ "url": "https://..." }], "usage": { "tokens": N } }.

POST /v1/videos/generations — video generation (asynchronous)

Video takes minutes to generate, so it is asynchronous: POST creates a task and charges tokens, then poll GET /v1/videos/generations/<id>. On error/timeout the tokens are refunded. Models: seedance-2.0, veo-3.1, veo-3.1-fast, veo-3.1-lite, sora-2, sora-2-pro, kling-o3, kling-3.0, kling-3-0-turbo, grok-imagine, wan-2.6.

Body fields: model, prompt, optional duration, resolution, speed (seedance), mode (kling/grok), quality (sora-2-pro), audio (kling), aspect_ratio, image_urls, multi_shots (storyboard — kling-3.0 and wan-2.6).

Additionally for kling-3.0:

# 1. create the task
curl https://neuralspace.pro/v1/videos/generations \
  -H "x-api-key: nsk-your_key" \
  -H "content-type: application/json" \
  -d '{"model": "seedance-2.0", "prompt": "Sunset over the ocean", "duration": 5}'
# response: { "id": "task_...", "status": "pending", "poll_url": "..." }

# 2. poll the status until status != completed/failed
curl https://neuralspace.pro/v1/videos/generations/task_... \
  -H "x-api-key: nsk-your_key"
# when completed: { "status": "completed", "data": [{ "url": "https://..." }] }

POST /v1/music/generations — music generation (asynchronous)

Music (Suno) takes minutes to generate, so it is asynchronous: POST creates a task and charges tokens, then poll GET /v1/music/generations/<id>. On error/timeout the tokens are refunded. One generation usually returns 2 tracks. Models: V5_5, V5, V4_5PLUS, V4_5, V4.

Body fields: model, prompt (description of the music; in custom_mode with vocals — the song lyrics), optional instrumental (no vocals), custom_mode (requires style and title), style, title, negative_tags, vocal_gender (m/f), duration — track length in seconds, from 10 to 360 (available only for the V5_5 model together with custom_mode: true; without it the model chooses the length).

# 1. create the task
curl https://neuralspace.pro/v1/music/generations \
  -H "x-api-key: nsk-your_key" \
  -H "content-type: application/json" \
  -d '{"model": "V5", "prompt": "Energetic synthwave about a night city"}'
# response: { "id": "task_...", "status": "pending", "poll_url": "..." }

# 2. poll the status until status != completed/failed
curl https://neuralspace.pro/v1/music/generations/task_... \
  -H "x-api-key: nsk-your_key"
# when completed: { "status": "completed", "data": [{ "url": "https://...", "title": "...", "duration": 123 }] }

POST /v1/audio/speech — speech synthesis (OpenAI format)

Compatible with the OpenAI Audio Speech API. Synchronous: the response contains a ready audio file URL. Tokens are charged only on success, by number of characters. Models: tts-1, tts-1-hd.

Body fields: model, input (text, up to 4096 characters), optional voice (alloy/echo/fable/onyx/nova/shimmer), response_format (mp3/opus/aac/flac/wav).

curl https://neuralspace.pro/v1/audio/speech \
  -H "Authorization: Bearer nsk-your_key" \
  -H "content-type: application/json" \
  -d '{
    "model": "tts-1",
    "voice": "alloy",
    "input": "Hello! This is NeuralSpace speech synthesis."
  }'

POST /v1/audio/transcriptions — audio transcription (OpenAI format)

Compatible with the OpenAI Audio Transcriptions API (Whisper). The file is sent as multipart/form-data. Synchronous: the response contains the recognized text. Tokens are charged only on success, by audio duration (estimated from file size). Models: whisper-large-v3, whisper-1. File limit — 25 MB.

Form fields: file (audio: mp3/mp4/mpeg/mpga/m4a/wav/webm/ogg/flac), model (whisper-large-v3; the legacy whisper-1 is accepted and run as large-v3), optional language (ISO code, e.g. ru/en), prompt (context hint).

curl https://neuralspace.pro/v1/audio/transcriptions \
  -H "Authorization: Bearer nsk-your_key" \
  -F model="whisper-large-v3" \
  -F file="@audio.mp3"
# response: { "text": "...", "model": "whisper-large-v3", "usage": { "tokens": 0.2 } }

Response: { "text": "recognized text", "model": "whisper-large-v3", "usage": { "tokens": 0.2 } }.

POST /v1/characters — create a character / voice assistant

Creates an AI character or voice assistant in your account (available in the “Characters” section). Without image_url a voice assistant (voice_only) with a preset voice is created — fast and cheap. With image_url (a public photo URL) a character with a video avatar is created. Cost — 10 tokens, charged on success.

Fields: name (required), instruction (persona / system instruction), voice (for voice assistant: alloy, echo, shimmer, sage, verse, coral, ash, ballad; default alloy), start_script (greeting), image_url (photo for a video avatar), language (ru/en).

curl https://neuralspace.pro/v1/characters \
  -H "Authorization: Bearer nsk-your_key" \
  -H "Content-Type: application/json" \
  -d '{ "name": "My assistant", "instruction": "A friendly product assistant", "voice": "verse" }'
# response: { "character": { "id": "voice-...", "name": "...", "characterType": "voice_only", "voice": {...} } }

GET /v1/characters — list your characters

Returns { "data": [{ "id", "name", "characterType", "voice", "isVoiceOnly", ... }] }.

Models and prices

Prices are in site tokens (1 token = 1 ₽). Rates are dynamic and may change; this page always reflects the current values.

Prices float: each request is charged its actual cost, so the figures in the tables are a reference, not a fixed rate. Where a model price moves during the day, the range over the last 24 hours is shown below it.

Text models (per 1M tokens)

ModelIDInput / 1MOutput / 1M
Claude Haiku 4.5claude-haiku-4-540.5211
Claude Sonnet 4.6claude-sonnet-4-6186.5932
Claude Sonnet 5claude-sonnet-5151759
Claude Opus 4.6claude-opus-4-62531269.5
Claude Opus 4.7claude-opus-4-72531269.5
Claude Opus 4.8claude-opus-4-83551775.5
Claude Opus 5claude-opus-53551775.5
Claude Fable 5claude-fable-57103551

Chat models (per 1M tokens)

ModelIDInput / 1MOutput / 1M
GPT-5.6 Solgpt-5-62071242.5
GPT-5.6 Terragpt-5-6-balanced103.5621
GPT-5.6 Lunagpt-5-6-fast52251.5
GPT-5 Minigpt-5-mini44.5355
GPT-5.4 Minigpt-5-4-mini133799
Grok 4.6grok-4-6118.5355
Grok 4.5grok-4-5118.5355
Grok 4.3grok-4-389177.5
Kimi K2.6 (Moonshot)kimi-k2.6140.5
80.08–140.5 over 24h
591.5
337.2–591.58 over 24h
Kimi K3 (Moonshot)kimi-k3443.52218.5
GLM-5.2 (Zhipu)glm-5.2143449
DeepSeek V4 Flashdeepseek-v4-flash20.541.5
DeepSeek V4 Prodeepseek-v4-pro64.5128.5

Images (per image)

ModelIDRates (tokens)Unit
Nano Banana (Gemini 2.5 Flash)nano-banana1K — 3.5per image
Nano Banana Pronano-banana-pro1K — 9; 2K — 11.5; 4K — 15per image
Nano Banana 2nano-banana-21K — 7; 2K — 10.5; 4K — 16per image
Nano Banana 2 Litenano-banana-2-lite1K — 3.5per image
FLUX 2 Proflux-2-pro1K — 6; 2K — 6per image
GPT Image 1.5gpt-image-15medium — 3.5; high — 19.5per image
GPT Image 2gpt-image-21K — 5.5; 2K — 9; 4K — 14per image
GPT Image 2 Progpt-image-2-prolow — 1.07; medium — 9.41; high — 37.47per image
Seedream 4.5seedream-45per image — 6per image
Seedream 5 Liteseedream-5-liteper image — 5per image
Seedream 5 Proseedream-5-probasic (1K) — 6; high (2K) — 12.5per image
Grok Imagine 1grok-imageper image — 3.5per image
Grok Imagine 2grok-imagine-image-2per image — 3per image
NS-Imagens-imageper image — 0.25per image
Z-Imagez-imageper image — 0.7per image
Ideogram V3ideogramTURBO — 3; BALANCED — 6; QUALITY — 9per image
Midjourney v7midjourneyrelaxed — 2.5; fast — 6.5; turbo — 13.5per image

Video

ModelIDRates (tokens)Unit
Seedance 2.0 (ByteDance)seedance-2.0fast 720p — 59; standard 720p — 89; fast 1080p — 328; standard 1080p — 408per 5 s
Veo 3.1 Qualityveo-3.1per video — 222per video
Veo 3.1 Fastveo-3.1-fastper video — 53.5per video
Veo 3.1 Liteveo-3.1-liteper video — 26.5per video
Sora 2 (OpenAI)sora-210 c — 20; 15 c — 23.5per video
Sora 2 Pro (OpenAI)sora-2-prostandard 10 c — 100; standard 15 c — 166.5; high 10 c — 225; high 15 c — 416.5per video
Kling O3 (Kuaishou)kling-o3720p — 43; 1080p — 55.5; 4K — 206per 5 s
Kling 3.0 (Kuaishou)kling-3.0std — 51.5; pro — 66.5; 4K — 247per 5 s
Kling 3.0 Turbo (Kuaishou)kling-3-0-turbo720p — 66.5; 1080p — 83per 5 s
Grok Imagine (xAI)grok-imagine480p — 13; 720p — 24per 6 s
Wan 2.6 (Alibaba)wan-2.6720p — 63; 1080p — 94per 5 s

Music

ModelIDRates (tokens)Unit
Suno V5.5V5_5per generation — 10.5per generation
Suno V5V5per generation — 10.5per generation
Suno V4.5+V4_5PLUSper generation — 10.5per generation
Suno V4.5V4_5per generation — 10.5per generation
Suno V4V4per generation — 10.5per generation

Speech synthesis (per 1000 characters)

ModelIDRates (tokens)Unit
OpenAI TTStts-1per 1000 characters — 2.67per 1000 characters
OpenAI TTS HDtts-1-hdper 1000 characters — 5.33per 1000 characters

Audio transcription (per 1 minute)

ModelIDRates (tokens)Unit
Whisper large-v3whisper-large-v3per minute — 0.27per minute
Whisper (compat, = large-v3)whisper-1per minute — 0.27per minute

Errors

The text endpoint returns errors in the Anthropic format ({ "type": "error", "error": { "type", "message" } }), chat — in the OpenAI format ({ "error": { "message", "type" } }). Codes: 401 — missing/invalid key, 403 — account suspended, 429 — rate limit exceeded, 400 — invalid request or insufficient tokens.

Support and balance top-up: https://neuralspace.pro/payment. Manage keys: https://neuralspace.pro/api-keys.