NeuralSpace API

语言: Русский · English · العربية · 简体中文 · ko · ja · Deutsch · Français · Español · Italiano · Svenska · עברית · ייִדיש · हिन्दी · Nederlands · Português · Română · Polski · Čeština · Ελληνικά · Slovenčina · Magyar · Bahasa Indonesia · Bahasa Melayu · Dansk · Suomi · Norsk · Hrvatski

本页面为开发者和AI智能体提供的文档,无需身份验证即可访问,也支持自动化读取。

基础URL:https://neuralspace.pro。使用账户余额中的token付费(1 token = 1 ₽),无需订阅或国外银行卡。文本与对话接口兼容Anthropic和OpenAI的SDK——只需更改base_url和密钥即可。

身份验证

请在账户中创建API密钥:https://neuralspace.pro/api-keys。密钥形如nsk-...,仅显示一次。请在请求头中传递:

x-api-key: nsk-your_key

也支持使用Authorization: Bearer nsk-...请求头(适用于兼容OpenAI的客户端)。

MCP服务器——将NeuralSpace接入你的AI智能体

本API的所有能力(图像/视频/音乐生成、与LLM对话、语音合成与识别、余额查询、价格查询)也以MCP服务器(Model Context Protocol)形式提供——你可以将其接入Claude Code、Claude Desktop、Cursor及其他任意MCP客户端,让你的AI智能体以你的账户身份自主生成内容。

接入地址(Streamable HTTP,无会话):https://neuralspace.pro/mcp。身份验证方式与直接调用API相同,在Authorization: Bearer或x-api-key请求头中传入同样的nsk-...密钥。

# 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服务器提供的工具:list_models(模型列表及实时价格)、get_balance(余额)、chat(LLM对话)、generate_image、generate_video + check_video、generate_music + check_music、text_to_speech、transcribe_audio。计费与退款规则与直接调用API完全一致;成功生成的内容会以卡片形式出现在你的账户中。若客户端的MCP工具超时时间较短,建议为同步图像生成(最长约2分钟)适当延长该超时时间。

GET /v1/balance 与 GET /v1/models——服务接口

GET /v1/balance——查询密钥所属账户的当前token余额:{ "balance": N, "currency": "tokens" }。GET /v1/models——以机器可读格式返回所有模型及其实时价格(相当于本页面的JSON版本)。两者均需提供密钥。

POST /v1/messages——文本模型(Anthropic格式)

兼容Anthropic Messages API。可用模型:claude-haiku-4-5, claude-sonnet-5, claude-sonnet-5-5, claude-opus-5, claude-opus-5-5, claude-fable-5。

请求体字段:model、messages({role, content}对象数组,role为user/assistant)、max_tokens(1—32000)、可选的system。

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

通过Anthropic SDK(Python)调用:Anthropic(base_url="https://neuralspace.pro", api_key="nsk-...")。

POST /v1/chat/completions——对话模型(OpenAI格式)

兼容OpenAI Chat Completions API。可用模型:gpt-5-6, gpt-5-6-balanced, gpt-5-6-fast, gpt-6-astra, gpt-6-sol, gpt-6-luna, gpt-6-1-sol, gpt-6-1-sol-pro, gpt-5-mini, gpt-5-4-mini, grok-4-3, grok-4-5, grok-4-6, grok-4-7, gemini-3-8-flash, deepseek-v4.1-flash, deepseek-v4-pro, glm-5.3-flash, glm-5.3, kimi-k2.6, kimi-k3。

请求体字段:model、messages(role为system/user/assistant)、max_tokens或max_completion_tokens、可选的reasoning_effort(适用于GPT-5.6、GPT-6 Astra和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!"}]
  }'

通过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=zh",
  { headers: { Authorization: "Bearer nsk-your_key" } }
);

POST /v1/images/generations——图像生成

同步接口:响应中直接返回可用的图像URL。仅在生成成功时扣除token。可用模型: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, gpt-image-25, seedream-45, seedream-5-lite, seedream-5-flash, seedream-5-pro, grok-image, grok-imagine-image-2, ns-image, z-image, ideogram, midjourney。

请求体字段:model、prompt(最多5000字符)、可选的aspect_ratio(gpt-image-2-pro:1:1/3:2/2:3;gpt-image-25:auto/1:1/3:2/2:3/16:9/9:16/4:3/3:4/21:9,27:16/16:27/9:8/8:9仅支持1K)、resolution(1K/2K/4K)、variant(flare/sunburst——gpt-image-25)、background(transparent/opaque/auto——gpt-image-25)、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(数组——开启编辑/图生图模式)。

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": "太空中的一只猫,数字插画",
    "resolution": "2K"
  }'

响应:{ "data": [{ "url": "https://..." }], "usage": { "tokens": N } }。

POST /v1/videos/generations——视频生成(异步)

视频生成通常需要数分钟,因此采用异步方式:POST创建任务并扣除token,随后轮询GET /v1/videos/generations/<id>获取结果。若出错或超时,token将被退还。可用模型:seedance-2.0, seedance-2.5, 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, gemini-omni-flash-1-1, gemini-omni-1。

请求体字段:model、prompt、可选的duration、resolution、speed(seedance)、mode(kling/grok)、quality(sora-2-pro)、audio(kling)、aspect_ratio、image_urls、multi_shots(分镜脚本——kling-3.0和wan-2.6)。

对于kling-3.0,还可使用以下字段:

# 1. 创建任务
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": "海洋上的日落", "duration": 5}'
# response: { "id": "task_...", "status": "pending", "poll_url": "..." }

# 2. 轮询状态,直到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——音乐生成(异步)

音乐生成(Suno)通常需要数分钟,因此采用异步方式:POST创建任务并扣除token,随后轮询GET /v1/music/generations/<id>获取结果。若出错或超时,token将被退还。一次生成通常会返回2首曲目。可用模型:V6, V6_WILD, V6_MINI, V5_5, V5, V4_5PLUS, V4_5, V4。

请求体字段:model、prompt(音乐描述;在custom_mode下若包含人声,则为歌词内容)、可选的instrumental(纯伴奏,无人声)、custom_mode(需配合style和title使用)、style、title、negative_tags、vocal_gender(m/f)、duration——曲目时长(秒),范围10到360(V5_5、V6、V6_MINI和V6_WILD模型在custom_mode: true时可用;未指定时由模型自行决定时长)。

# 1. 创建任务
curl https://neuralspace.pro/v1/music/generations \
  -H "x-api-key: nsk-your_key" \
  -H "content-type: application/json" \
  -d '{"model": "V5", "prompt": "关于夜色都市的动感合成器浪潮音乐"}'
# response: { "id": "task_...", "status": "pending", "poll_url": "..." }

# 2. 轮询状态,直到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——语音合成(OpenAI格式)

兼容OpenAI Audio Speech API。同步接口:响应中直接返回可用的音频文件URL。仅在生成成功时按字符数扣除token。可用模型:tts-1, tts-1-hd。

请求体字段:model、input(文本,最多4096字符)、可选的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": "你好!这是NeuralSpace语音合成。"
  }'

POST /v1/audio/transcriptions——音频转录(OpenAI格式)

兼容OpenAI Audio Transcriptions API(Whisper)。文件以multipart/form-data格式发送。同步接口:响应中直接返回识别出的文本。仅在识别成功时按音频时长(根据文件大小估算)扣除token。可用模型:whisper-large-v3, whisper-1。文件大小限制——25 MB。

表单字段:file(音频格式:mp3/mp4/mpeg/mpga/m4a/wav/webm/ogg/flac)、model(whisper-large-v3;旧版whisper-1仍可使用,实际按large-v3运行)、可选的language(ISO语言代码,如ru/en)、prompt(上下文提示)。

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 } }

响应:{ "text": "识别出的文本", "model": "whisper-large-v3", "usage": { "tokens": 0.2 } }。

视频头像

会说话的视频头像及相关模式。目录:GET /v1/avatars(avatar_id)、GET /v1/avatars/voices?language=en(voice_id)、GET /v1/avatars/languages(翻译语言)、/v1/avatars/styles、/v1/avatars/templates、/v1/avatars/assets、/v1/avatars/brand-kits。生成为异步:使用 type 字段调用 POST /v1/avatars/generations,然后轮询 GET /v1/avatars/generations/<id>。代币在创建时扣除,失败时退还。

curl https://neuralspace.pro/v1/avatars/voices?language=en \
  -H "x-api-key: nsk-your_key"

curl https://neuralspace.pro/v1/avatars/generations \
  -H "x-api-key: nsk-your_key" \
  -H "content-type: application/json" \
  -d '{"type": "talking_avatar", "avatar_id": "avatar_...", "voice_id": "voice_...", "script": "Hello!"}'
# response: { "id": "task_...", "status": "pending", "poll_url": "..." }

POST /v1/characters——创建角色/语音助手

在你的账户中创建一个AI角色或语音助手(可在“角色”版块中查看)。若不提供image_url,则会创建一个使用预设音色的语音助手(voice_only)——速度快、成本低。若提供image_url(一张公开可访问的照片URL),则会创建带视频形象的角色。费用为10 token,成功后扣除。

字段:name(必填)、instruction(人设/系统指令)、voice(语音助手可选音色:alloy, echo, shimmer, sage, verse, coral, ash, ballad;默认alloy)、start_script(开场问候语)、image_url(用于生成视频形象的照片)、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——获取你的角色列表

返回{ "data": [{ "id", "name", "characterType", "voice", "isVoiceOnly", ... }] }。

模型与价格

价格单位为站内token(1 token = 1 ₽)。价格为动态浮动价,可能随时调整;本页面始终展示当前实时价格。

价格是浮动的:每次请求都按实际发生的成本计费,因此表格中的数字仅供参考,并非固定价格。若某模型的价格在一天内发生波动,将在其下方显示过去24小时内的价格区间。

文本模型(每100万token)

模型ID输入 / 100万输出 / 100万
Claude Haiku 4.5claude-haiku-4-540208.5
Claude Sonnet 5claude-sonnet-5149750
Claude Sonnet 5.5claude-sonnet-5-5140.5702
Claude Opus 5claude-opus-53511754.5
Claude Opus 5.5claude-opus-5-52811404
Claude Fable 5claude-fable-57023509.5

对话模型(每100万token)

模型ID输入 / 100万输出 / 100万
GPT-5.6 Solgpt-5-6204.51228
GPT-5.6 Terragpt-5-6-balanced80614
GPT-5.6 Lunagpt-5-6-fast51248.5
GPT-6 Astragpt-6-astra1461.57308.5
GPT-6 Solgpt-6-sol87.5
84.05–87.75 过去24小时
438.5
GPT-6 Lunagpt-6-luna4.522
GPT-6.1 Solgpt-6-1-sol87.5438.5
GPT-6.1 Sol Progpt-6-1-sol-pro292.5
长上下文(从 272 000 个输入 token 起):584.5 / 2192.5 / 100万
1461.5
GPT-5 Minigpt-5-mini44351
GPT-5.4 Minigpt-5-4-mini131.5789.5
Grok 4.3grok-4-387.5175.5
Grok 4.5grok-4-5117351
Grok 4.6grok-4-6117351
Grok 4.7grok-4-7117351
Gemini 3.8 Flashgemini-3-8-flash33164.5
DeepSeek V4.1 Flashdeepseek-v4.1-flash20.541
DeepSeek V4 Prodeepseek-v4-pro63.5127
GLM-5.3 Flash (Zhipu)glm-5.3-flash2273
GLM-5.3 (Zhipu)glm-5.3204.5643
Kimi K2.6 (Moonshot)kimi-k2.6139584.5
Kimi K3 (Moonshot)kimi-k398
97.93–105.24 过去24小时
2046.5
1900.2–2046.37 过去24小时

图像(每张)

模型ID价格(token)单位
Nano Banana (Gemini 2.5 Flash)nano-banana1K — 3.5每张图像
Nano Banana Pronano-banana-pro1K — 9; 2K — 11.5; 4K — 15每张图像
Nano Banana 2nano-banana-21K — 7; 2K — 10.5; 4K — 16每张图像
Nano Banana 2 Litenano-banana-2-lite1K — 3.5每张图像
FLUX 2 Proflux-2-pro1K — 6; 2K — 6每张图像
GPT Image 1.5gpt-image-15medium — 3.5; high — 19.5每张图像
GPT Image 2gpt-image-21K — 5.5; 2K — 9; 4K — 14每张图像
GPT Image 2 Progpt-image-2-prolow — 2.92; medium — 11.17; high — 38.9每张图像
ChatGPT Images 2.5gpt-image-251K — 5.5; 2K — 9; 4K — 14.5每张图像
Seedream 4.5seedream-45每张图片 — 5.5每张图像
Seedream 5 Liteseedream-5-lite每张图片 — 5每张图像
Seedream 5 Flashseedream-5-flash每张图片 — 3每张图像
Seedream 5 Proseedream-5-probasic (1K) — 6; high (2K) — 12.5每张图像
Grok Imagine 1grok-image每张图片 — 3.5每张图像
Grok Imagine 2grok-imagine-image-2每张图片 — 3.5每张图像
NS-Imagens-image每张图片 — 0.25每张图像
Z-Imagez-image每张图片 — 0.7每张图像
Ideogram V3ideogramTURBO — 3; BALANCED — 6; QUALITY — 9每张图像
Midjourney v7midjourneyrelaxed — 2.5; fast — 6.5; turbo — 13.5每张图像

视频

模型ID价格(token)单位
Seedance 2.0 (ByteDance)seedance-2.0fast 720p — 58; standard 720p — 88; fast 1080p — 325; standard 1080p — 404每5秒
Seedance 2.5 (ByteDance)seedance-2.5480p — 102; 720p — 230; 1080p — 417每5秒
Veo 3.1 Qualityveo-3.1每个视频 — 219.5每个视频
Veo 3.1 Fastveo-3.1-fast每个视频 — 52.5每个视频
Veo 3.1 Liteveo-3.1-lite每个视频 — 26.5每个视频
Sora 2 (OpenAI)sora-210 c — 20; 15 c — 23.5每个视频
Sora 2 Pro (OpenAI)sora-2-prostandard 10 c — 100; standard 15 c — 166.5; high 10 c — 225; high 15 c — 416.5每个视频
Kling O3 (Kuaishou)kling-o3720p — 51; 1080p — 65.5; 4K — 244每5秒
Kling 3.0 (Kuaishou)kling-3.0std — 51; pro — 65.5; 4K — 244每5秒
Kling 3.0 Turbo (Kuaishou)kling-3-0-turbo720p — 65.5; 1080p — 82每5秒
Grok Imagine (xAI)grok-imagine480p — 12.5; 720p — 23.5每6秒
Wan 2.6 (Alibaba)wan-2.6720p — 62; 1080p — 93每5秒
Gemini Omni 1.1 Flashgemini-omni-flash-1-1360p — 58; 720p — 58; 1080p — 58; 4K — 135每5秒
Gemini Omni 1gemini-omni-1720p — 58; 1080p — 58; 4K — 135每5秒

音乐

模型ID价格(token)单位
Suno V6V6每次生成 — 10.5每次生成
Suno V6 WildV6_WILD每次生成 — 10.5每次生成
Suno V6 MiniV6_MINI每次生成 — 10.5每次生成
Suno V5.5V5_5每次生成 — 10.5每次生成
Suno V5V5每次生成 — 10.5每次生成
Suno V4.5+V4_5PLUS每次生成 — 10.5每次生成
Suno V4.5V4_5每次生成 — 10.5每次生成
Suno V4V4每次生成 — 10.5每次生成

语音合成(每1000字符)

模型ID价格(token)单位
OpenAI TTStts-1每 1000 字符 — 2.64每1000字符
OpenAI TTS HDtts-1-hd每 1000 字符 — 5.27每1000字符

音频转录(每1分钟)

模型ID价格(token)单位
Whisper large-v3whisper-large-v3每分钟 — 0.27每分钟
Whisper(兼容,= large-v3)whisper-1每分钟 — 0.27每分钟

视频头像

模型ID价格(token)单位
Talking avatartalking_avatar11.5每1秒
Video translationvideo_translation2.5每1秒
AI clippingai_clipping26.5每个视频
Cinematic avatarcinematic_avatar1228每个视频
Video agentvideo_agent17.5每1秒
Text to speechtext_to_speech0.5每1秒
Filler word removalfiller_removal105.5每1秒
Animation renderhyperframes17.5每分钟
Studio (scene merge)studio11.5每1秒
Proofread translationproofread0.7每1秒

错误

文本接口返回Anthropic格式的错误({ "type": "error", "error": { "type", "message" } }),对话接口返回OpenAI格式的错误({ "error": { "message", "type" } })。错误代码:401——密钥缺失或无效,403——账户已被暂停,429——超出速率限制,400——请求无效或token余额不足。

技术支持与余额充值:https://neuralspace.pro/payment。管理密钥:https://neuralspace.pro/api-keys。

Ready-to-copy settings for OpenCode, Claude Code, Cursor, Harness and MCP.