NeuralSpace API

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

本页面为开发者和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: Bearerx-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_imagegenerate_video + check_videogenerate_music + check_musictext_to_speechtranscribe_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-4-6, claude-sonnet-5, claude-opus-4-6, claude-opus-4-7, claude-opus-4-8, claude-opus-5, claude-fable-5

请求体字段:modelmessages{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-4-8",
    "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-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

请求体字段:modelmessages(role为system/user/assistant)、max_tokensmax_completion_tokens、可选的reasoning_effort(适用于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!"}]
  }'

通过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, seedream-45, seedream-5-lite, seedream-5-pro, grok-image, grok-imagine-image-2, ns-image, z-image, ideogram, midjourney

请求体字段:modelprompt(最多5000字符)、可选的aspect_ratio(gpt-image-2-pro支持:1:1/3:2/2:3)、resolution(1K/2K/4K——视模型支持情况而定)、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, 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

请求体字段:modelprompt、可选的durationresolutionspeed(seedance)、mode(kling/grok)、quality(sora-2-pro)、audio(kling)、aspect_ratioimage_urlsmulti_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首曲目。可用模型:V5_5, V5, V4_5PLUS, V4_5, V4

请求体字段:modelprompt(音乐描述;在custom_mode下若包含人声,则为歌词内容)、可选的instrumental(纯伴奏,无人声)、custom_mode(需配合styletitle使用)、styletitlenegative_tagsvocal_gender(m/f)、duration——曲目时长(秒),范围10到360(仅V5_5模型在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

请求体字段:modelinput(文本,最多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)、modelwhisper-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 } }

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(用于生成视频形象的照片)、languageru/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-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

对话模型(每100万token)

模型ID输入 / 100万输出 / 100万
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 过去24小时
591.5
337.2–591.58 过去24小时
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

图像(每张)

模型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 — 1.07; medium — 9.41; high — 37.47每张图像
Seedream 4.5seedream-45每张图片 — 6每张图像
Seedream 5 Liteseedream-5-lite每张图片 — 5每张图像
Seedream 5 Proseedream-5-probasic (1K) — 6; high (2K) — 12.5每张图像
Grok Imagine 1grok-image每张图片 — 3.5每张图像
Grok Imagine 2grok-imagine-image-2每张图片 — 3每张图像
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 — 59; standard 720p — 89; fast 1080p — 328; standard 1080p — 408每5秒
Veo 3.1 Qualityveo-3.1每个视频 — 222每个视频
Veo 3.1 Fastveo-3.1-fast每个视频 — 53.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 — 43; 1080p — 55.5; 4K — 206每5秒
Kling 3.0 (Kuaishou)kling-3.0std — 51.5; pro — 66.5; 4K — 247每5秒
Kling 3.0 Turbo (Kuaishou)kling-3-0-turbo720p — 66.5; 1080p — 83每5秒
Grok Imagine (xAI)grok-imagine480p — 13; 720p — 24每6秒
Wan 2.6 (Alibaba)wan-2.6720p — 63; 1080p — 94每5秒

音乐

模型ID价格(token)单位
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.67每1000字符
OpenAI TTS HDtts-1-hd每 1000 字符 — 5.33每1000字符

音频转录(每1分钟)

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

错误

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

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