LOCAL API DOCS · HOSTED ON-SITE

SalpX API Reference

SalpX is fully OpenAI-compatible — point your base_url at SalpX and one key unlocks 50+ models across chat, images, and video. This page consolidates every AI model endpoint and management endpoint; everything is hosted on SalpX itself, with no third-party redirects.

Base URL https://www.salpx.com/v1 Auth Bearer <API Key> Spec OpenAI-compatible

01Quick start

① Create an API key in the console; ② set the base URL to https://www.salpx.com/v1; ③ fire a request:

curl · chat
curl https://www.salpx.com/v1/chat/completions \
  -H "Authorization: Bearer $SALPX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "messages": [{"role": "user", "content": "Hello, introduce yourself"}]
  }'

OpenAI SDK compatible: just set base_url to https://www.salpx.com/v1 — the rest of your code stays the same.

02Authentication

Every request carries the API key in an HTTP header:

HTTP Header
Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxx
  • Create, view, and disable keys under Console → Token management.
  • Keys support quota caps, expiry dates, and allowed groups.
  • Keep your keys safe — never ship them in front-end code or public repos.

03Base URL & compatibility

CapabilityMethod / pathCompatible with
Chat / textPOST /v1/chat/completionsOpenAI Chat
Image generationPOST /v1/images/generationsOpenAI Images
Video generationPOST /v1/videosAsync task
Model listGET /v1/modelsOpenAI Models

Only models that are priced and enabled appear in /v1/models and the model square; calls to disabled models are rejected (see error codes).

04AI model endpoints

A unified model-call layer in OpenAI format, covering chat, completions, embeddings, images, video, and realtime audio. 11 endpoint families:

01
Models
List available models.
GET/v1/models
02
Chat
Chat completions with multi-turn, reasoning, tool calls, and streaming.
POST/v1/chat/completions
03
Completions
Legacy text completions.
POST/v1/completions
04
Embeddings
Text embedding vectors.
POST/v1/embeddings
05
Rerank
Document reranking.
POST/v1/rerank
06
Moderations
Content safety screening (one compliance tool — it does not replace your own safety governance or upstream content policies; public-facing services should add abuse reporting, log auditing, and enforcement).
POST/v1/moderations
07
Audio
Speech recognition and synthesis.
POST/v1/audio/speech/v1/audio/transcriptions
08
Realtime
Realtime audio streaming.
POST/v1/realtime
09
Images
AI image generation.
POST/v1/images/generations
10
Video
AI video generation (async tasks).
POST/v1/videos
11
Unimplemented
Placeholder endpoints, not implemented yet (e.g. Files).
GET/v1/files
🎵 Music generation (Suno) uses its own /suno/submit/{MUSIC,LYRICS} and /suno/fetch paths — outside the /v1 namespace. See Section 07 · Music (Suno).

05Chat / image / video examples

Chat

Request body
{
  "model": "claude-opus-4-8",
  "messages": [{"role":"user","content":"Write quicksort in Python"}],
  "stream": false
}
gpt-5.6-solgpt-5.6-lunagpt-6.1-sol claude-opus-4-8claude-sonnet-5-5gemini-4-argon gemini-3.8-flashdeepseek/deepseek-v4.1-flashqwen/qwen3.8-max glm/glm-5.3-flashkimi/kimi-k3
✨ New Gemini models gemini-4-argon and gemini-3.8-flash: use the POST /v1/chat/completions endpoint above (OpenAI chat format, supports stream), billed per token — gemini-4-argon: ¥1 / 1M input tokens, ¥5 / 1M output tokens; gemini-3.8-flash: ¥0.75 / 1M input, ¥3.75 / 1M output. gemini-3.8-flash thinks before answering and the thinking counts as output tokens — a tiny max_tokens (e.g. a few dozen) can leave room for thinking only and an empty reply, so leave it unset or generous.

Images

curl · image
curl https://www.salpx.com/v1/images/generations -H "Authorization: Bearer $KEY" \
  -d '{"model":"XY-nano-banana-pro-2k","prompt":"A luminous jellyfish drifting through a neon city, cinematic","n":1}'
gpt-image-2gpt-image-2.6-flaregpt-image-2.6-sunburst XY-nano-banana-pro-2kXY-gpt-image-2-2kLK-nano-banana-2.1-1k

Video

curl · video
curl https://www.salpx.com/v1/videos -H "Authorization: Bearer $KEY" \
  -d '{"model":"seedance-2","duration":10,"resolution":"720p","prompt":"A swarm of jellyfish slowly rising from the seabed, soft light"}'
seedance-2seedance-2-fastseedance-2-mini seedance-2-5seedance-2-fast-特价版seedance-2-mini-特价版 seedance-2.5-720p-hmtwan3.0-720pminimax-h3
⭐ Seedance 2.0 video generation (incl. virtual-human / live-action reference assets) → dedicated guide
seedance-2 (480p / 720p / 1080p / 4K), seedance-2-fast, seedance-2-mini (480p / 720p). Supports text-to-video, first-frame, first-and-last-frame, and all-round references (image / video / audio); billed by actual tokens, video references bill at the with-video rate, 4–15 seconds. For the rest of the Seedance / Wan / image lineups see Section 06 · Video / Images.
🔥 Seedance 2.0 budget edition → dedicated guide
Model ID seedance-2-fast-特价版 (seedance-2-mini-特价版 is offline for maintenance since Nov 13): 4 s or any whole-second duration from 6–14 s (5 s and 15 s discontinued), billed per second at ¥0.13/s, aspect_ratio sets the frame (since 2026-11-11 duration and aspect are unrestricted, seconds required). Same POST /v1/videos endpoint.

Seedance 2.5 · per-second billing · multimodal (native async)

Volcano's official Seedance 2.5, called via the native async endpoint POST /v1/video/generations, billed per second. Supports text-to-video, image-to-video (first frame / first+last frame), and multimodal reference generation (≤30 reference images, ≤10 reference videos, ≤10 reference audios), single continuous takes up to 30 seconds, audio on by default (can be disabled). Resolution is locked to 720p and frame rate to 24fps.

Prices updated 2026-08-10 (CNY, per second); the model square always has the live price.

ModelConditionPrice
seedance-2-5Without reference video (text / image to video)¥2/s
With reference video (multimodal reference)¥7/s
curl · text-to-video (per second)
curl https://www.salpx.com/v1/video/generations -H "Authorization: Bearer $KEY" \
  -d '{"model":"seedance-2-5","prompt":"A swarm of jellyfish slowly rising from the seabed, soft light, vertical","duration":5}'
curl · multimodal reference-to-video (image + video)
curl https://www.salpx.com/v1/video/generations -H "Authorization: Bearer $KEY" \
  -d '{
    "model": "seedance-2-5",
    "prompt": "Follow the subject of @image1 and the camera motion of @video1 to make an ad",
    "duration": 10,
    "metadata": {
      "generate_audio": true,
      "content": [
        {"type":"image_url","image_url":{"url":"https://reference-image.png"},"role":"reference_image"},
        {"type":"video_url","video_url":{"url":"https://reference-video.mp4"},"role":"reference_video"}
      ]
    }
  }'

Required: model / prompt / duration (whole seconds, max 30). Optional: images (top-level array: one image = first frame for image-to-video; two images = first/last frame), metadata.generate_audio (default true; false for silent output), metadata.content (multimodal references, each with a role: reference_image / reference_video / reference_audio; limits ≤30 images / ≤10 videos / ≤10 audios). Resolution is locked to 720p, frame rate to 24fps — no need to send them (they are ignored if you do). Billing: any request containing a reference video bills at ¥7/s, otherwise ¥2/s; charge = unit price × duration.

Async flow: the submit call returns a task_id; poll GET /v1/video/generations/{task_id} until status=succeeded, then grab the video URL. Set client / HTTP timeouts to ≥ 600 seconds. Failed generations or moderation rejections are treated as failures and fully refunded automatically — no charge.

06Video / Images

This section rounds up the Seedance, Wan 3.0, and MiniMax H3 video families plus the GPT Image / XY / LK banana image families on SalpX. Video uses the /v1/videos or /v1/video/generations async tasks; images use /v1/images/generations. Each route has its pricing table below and a dedicated guide.

How to call

  • Endpoints split by route: video via POST /v1/videos or /v1/video/generations (async: create task → poll → fetch); images via POST /v1/images/generations. Put the model ID from the corresponding guide in model.
  • Video duration goes in seconds / duration as whole seconds (supported ranges per route below); images use size or the resolution tier embedded in the model name.
  • Any video / image task that fails, times out, or returns no result is treated as failed and auto-refunded.
🔥 Seedance 2.5 720p (-hmt) → dedicated guide
(4–30 s) billed per second: without reference video seedance-2.5-720p-hmt ¥0.88 / s (incl. first-frame / first+last-frame), with reference video seedance-2.5-ref-720p-hmt ¥0.98 / s — reference images / reference audio / generated audio cost nothing extra.
Seedance 2.5 flash (same guide): seedance-2.5-flash-720p-hmt ¥0.79 / s, seedance-2.5-flash-480p-hmt ¥0.36 / s, with reference video seedance-2.5-flash-ref-720p-hmt ¥0.97 / s.
Section 08 of the same guide: Seedance 2.0 / fast / mini 720p / 1080p per-second — without references e.g. seedance-2.0-mini-720p-hmt, with references e.g. seedance-2.0-mini-ref-720p-hmt (12 in total), 4–15 s, ¥0.37–¥1.61 / s, same price with or without references.
🔥 Seedance 2.5 (-yy) → dedicated guide
(15–30 s) billed per second: 480p seedance-2.5-480p-yy ¥0.45 / s, 720p seedance-2.5-720p-yy ¥0.63 / s. Supports text-to-video, reference images, and reference audio (no surcharge); reference video is not supported.
🔥 Seedance 2.0 → dedicated guide
Billed per second; the model name sets the edition and resolution: standard seedance-2.0-480p / 720p / 1080p / 4k, Fast seedance-2.0-fast-480p / 720p, Mini seedance-2.0-mini-480p / 720p. Pick the kd / hm line with line (standard 720P ¥0.6930 / ¥0.7920 per second, Mini 480P from ¥0.0805 per second); failed jobs switch lines automatically by default (turn off with auto_switch: false) and are billed at the line actually used. 4–15 seconds, text-to-video, first frame, first-last frame, reference image / video / audio, videos with sound.
🔥 Wan 3.0 → dedicated guide
Billed per second; the model name sets the resolution: wan3.0-480p, wan3.0-720p, wan3.0-1080p. Use line to pick a route: kd / hm / rh / rhp (high-speed) — at 720p respectively ¥0.36 / ¥0.56 / ¥0.63 / ¥1.29 per second. On failure it auto-switches routes (disable with auto_switch: false) and bills by the route actually used. 2–30 s; text-to-video, first/last frame, reference image / video / audio, document / webpage-to-video; audio on by default.

Images · XY series (per call · OpenAI image endpoint)

Base models GPT Image 2, GPT Image 2.5 Flare / Sunburst, GPT Image 2.6 Flare / Sunburst and Nano Banana Pro, for 14 SKUs in total in the XY series; the GPT Image 2.5 / 2.6 4K SKUs always render at the highest quality at ¥0.30 per call. Another set of 5 base models + 4 4K SKUs is driven by size (see “GPT Image 2.5 / 2.6 and the 4K tiers” below). All use the standard OpenAI image endpoint POST /v1/images/generations; for image-to-image, pass an images array to the same endpoint, or upload files directly via POST /v1/images/edits as multipart.

Prices updated 2026-11-24 (CNY).

ModelBase modelResolutionPrice
XY-gpt-image-2-1kGPT Image 21K¥0.14/call
XY-gpt-image-2-2kGPT Image 22K¥0.30/call
XY-gpt-image-2-4kGPT Image 24K¥0.31/call
XY-gpt-image-2.5-flare-1kGPT Image 2.5 Flare1K¥0.23/call
XY-gpt-image-2.5-flare-2kGPT Image 2.5 Flare2K¥0.28/call
XY-gpt-image-2.5-flare-4kGPT Image 2.5 Flare4K · max quality¥0.30/call
XY-gpt-image-2.5-sunburst-4kGPT Image 2.5 Sunburst4K · max quality¥0.30/call
XY-gpt-image-2.6-flare-4kGPT Image 2.6 Flare4K · max quality¥0.30/call
XY-gpt-image-2.6-sunburst-4kGPT Image 2.6 Sunburst4K · max quality¥0.30/call
XY-nano-banana-pro-2kNano Banana Pro2K¥0.15/call
XY-nano-banana-pro-4kNano Banana Pro4K¥0.19/call
XY-nano-banana-pro-cl-2kNano Banana Pro CL · high-quality route2K¥0.36/call
XY-nano-banana-pro-cl-4kNano Banana Pro CL · high-quality route4K¥0.46/call
XY-nano-banana-2-lite-1kNano Banana 2 Lite · low latency1K¥0.12/call
(XY series only) The resolution lives in the model name. resolution / quality in the request body are ignored — the model name always wins; to change tiers, change the model name. The size-driven set above is the opposite: both size and quality take effect. Also: Nano Banana Pro has no 1K tier, only 2K / 4K.
curl · text-to-image
curl --max-time 300 https://www.salpx.com/v1/images/generations \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{
    "model": "XY-nano-banana-pro-2k",
    "prompt": "Neon cyberpunk cityscape at night, wet streets reflecting the lights",
    "size": "16:9"
  }'
curl · image-to-image (with references)
curl --max-time 300 https://www.salpx.com/v1/images/generations \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{
    "model": "XY-gpt-image-2-2k",
    "prompt": "Keep the subject, replace the background with a dusk beach",
    "images": [
      "https://your-cdn.com/ref.png",
      "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ..."
    ],
    "size": "3:2"
  }'

GPT Image 2.5 / 2.6 and the 4K tiers (size-driven)

Since 2026-11-24 this set renders by size: the tier is encoded in the model name — no suffix means 2K (long edge 2048), a -4k suffix means 4K (long edge 3840). Same endpoint, returns data[0].b64_json.

ModelTierPositioningPrice
gpt-image-2.6-sunburst2KBest generation & refinement¥0.12/call
gpt-image-2.6-flare2KEveryday / fast, high volume¥0.12/call
gpt-image-2.6-sunburst-4k4KBest generation & refinement¥0.30/call
gpt-image-2.6-flare-4k4KEveryday / fast, high volume¥0.30/call
gpt-image-2.5-sunburst2KBest generation & refinement¥0.08/call
gpt-image-2.5-flare2KEveryday / fast, high volume¥0.08/call
gpt-image-2.5-sunburst-4k4KBest generation & refinement¥0.25/call
gpt-image-2.5-flare-4k4KEveryday / fast, high volume¥0.25/call
gpt-image-2Tier follows sizePrevious-generation base model¥0.07/call

Prices updated 2026-11-24 (CNY). The 1K tier is not sold separately yet; for smaller images pass 1k:ratio in size and you are billed at the model's normal rate.

How to write size (tier + aspect)

ValueTierOutput
4k:16:94K3840×2160
4k:1:14K3840×3840
4k:9:164K2160×3840
2k:4:32K2048×1536
16:9 (ratio only)2K2048×1152
1k:16:91K1024×576
3840x2160 (exact pixels)From the long edgeHonoured up to the model's tier (use a *-4k model for a true 3840)
auto / omittedNo resamplingBase models return their native size (≈1.6MP, PNG); *-4k models render at their default 4K aspect

Tiers are keyed on the long edge (1K=1024, 2K=2048, 4K=3840); the short edge follows the ratio and is rounded to an even number. Any N:M ratio works. If the requested ratio differs from the model's native one, the platform does a cover centre crop with no letterboxing — keep important elements near the centre.

The tier follows the model name. Asking a base model for 4k:16:9 is clamped back to 2K (response header X-Imgratio-Clamped: 1) because it is billed as 2K; switch to a *-4k model for 4K. A *-4k model always renders at 4K regardless of the requested tier.
ParameterRequiredNotes
modelYesA model from the table above; the -4k suffix sets the tier
promptYesThe prompt; Chinese or English both work
sizeNoTier + aspect, syntax above. Always pass it explicitly; omitting it or passing auto returns the model's native size (≈1.6MP PNG)
qualityNolow / medium / high (default) / max; affects only detail and file size, not resolution or price
imagesNoReference images (image-to-image): a publicly downloadable https URL or data:image/...;base64,; up to 16
nNoMust be 1
curl · 4K text-to-image (3840×2160)
curl --max-time 300 https://www.salpx.com/v1/images/generations \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6-sunburst-4k",
    "prompt": "Old town street after rain, brick walls and wrought-iron windows, wet reflections",
    "size": "4k:16:9",
    "quality": "max"
  }'
curl · 2K image-to-image (with references)
curl --max-time 300 https://www.salpx.com/v1/images/generations \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6-flare",
    "prompt": "Keep the subject, replace the background with a beach at dusk",
    "images": ["https://your-cdn.com/ref.png"],
    "size": "2k:3:4"
  }'

You can also use POST /v1/images/edits to upload files as multipart (fields image[], prompt, model, size) at the same price; when size is omitted a *-4k model renders at its default 4K aspect, while base models return their native size. Failed generations are not billed.

With size the response reports output_format: "jpeg"; with auto / no size it is png. data[0].size holds the real pixels — worth checking before you store the file. A 4K image usually takes 15–60 s.

Response format

A success returns 200 with the image embedded as base64 in data[0].b64_json — not a URL: write it straight to disk, no link expiry to worry about.

200 response
{
  "created": 1789045231,
  "data": [{ "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..." }]
}
Confirm these three things before integrating — they cause most failures:
① Set client timeouts to ≥ 300 s — a single image takes 20–120 s; default 30 / 60 s will always break.
② Budget response bodies for 10 MB — 2K / 4K originals run 2–5 MB and base64 adds another third; the default 1 MB will explode.
③ Reference-image URLs must be downloadable by any third party — pre-signed object-storage links or addresses requiring login / Referer cannot be fetched by us and fail before generation; if unsure, send base64.
Also: n must be 1 — anything above 1 returns 400; failed generations are not billed.

07Music (Suno)

SalpX offers AI song generation and lyric generation through its Suno channel. Music is an async task: submit to get a task_id, then poll /suno/fetch for results. The endpoints live outside the /v1 namespace, under their own /suno/* paths.

ModelCapabilitySubmit endpointOutput per callPrice (per call)
suno_musicSong generation (vocals / instrumental)POST /suno/submit/MUSIC2 songs¥0.09
suno_lyricsLyric generationPOST /suno/submit/LYRICS2 lyrics¥0.01

You do not send model: the action in the path (MUSIC / LYRICS) decides the model, routing, and billing. model is only used for display in the model square and usage stats. The model square has live prices; groups settle at their own ratios.

Submitting a music task

curl · simple mode (one-line description)
curl https://www.salpx.com/suno/submit/MUSIC \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "gpt_description_prompt": "An upbeat summer folk song, acoustic guitar led, male vocal",
    "mv": "V6"
  }'
curl · custom mode (your own lyrics / style / title)
curl https://www.salpx.com/suno/submit/MUSIC \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "[Verse]\nBefore the dawn breaks\nYou stand at the door\n[Chorus]\nThe neon is still on\nThe city slowly wakes",
    "tags": "chinese folk, acoustic guitar, warm male vocal",
    "title": "Corner Store at 3 AM",
    "mv": "V6"
  }'
FieldTypeNotes
gpt_description_promptstringSimple mode: describe the song you want in one line; the model writes lyrics and arranges. Pick this or prompt.
promptstringCustom mode: your own lyrics, with structure markers like [Verse] / [Chorus].
tagsstringStyle tags (comma-separated). Non-empty switches to custom mode.
titlestringSong title. Non-empty switches to custom mode.
make_instrumentalbooltrue = instrumental (no vocals).
mvstringVersion: V6 (default, best quality) / V6_MINI (faster) / V6_WILD (more adventurous).
continue_clip_id / continue_at / task_idstring / numberUsed when continuing an existing clip; omit for normal generation.

A successful submit returns a task ID (not the song URL):

Response
{"code":"success","message":"","data":"task_lP31nQboYikgfI8pjlJ5g07HZaDTtGWH"}

Fetching results

Batch query: POST /suno/fetch with body {"ids":["task_xxx", ...]}; single query: GET /suno/fetch/{task_id}. Generation usually finishes in 20–60 seconds — poll every 5 s or so and set timeouts ≥ 300 s.

curl · batch query
curl https://www.salpx.com/suno/fetch \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"ids":["task_lP31nQboYikgfI8pjlJ5g07HZaDTtGWH"]}'
Response · completed (truncated)
{
  "code": "success",
  "data": [
    {
      "task_id": "task_lP31nQboYikgfI8pjlJ5g07HZaDTtGWH",
      "action": "MUSIC",
      "status": "SUCCESS",
      "progress": "100%",
      "fail_reason": "",
      "submit_time": 1793878705,
      "finish_time": 1793878726,
      "quota": 45000,
      "data": {
        "clips": {
          "61c7bd26-9d49-4295-9e39-504b96ce5b40": {
            "id": "61c7bd26-9d49-4295-9e39-504b96ce5b40",
            "title": "Midnight Piano",
            "status": "complete",
            "audio_url": "https://tempfile.aiquickdraw.com/r/61c7bd26-....mp3",
            "stream_audio_url": "https://audiostream.kie.ai/stream/61c7bd26-....mp3",
            "image_url": "https://cdn2.suno.ai/image_61c7bd26-....jpeg",
            "text": "[Instrumental]",
            "metadata": {
              "tags": "Solo piano instrumental, slow and contemplative",
              "duration": 128.4
            }
          },
          "second-clip-id": { "…": "same structure as above" }
        }
      }
    }
  ]
}

Status: SUBMITTED → IN_PROGRESS (watch progress) → SUCCESS / FAILURE (fail_reason explains). data.clips is an object keyed by clip_id; one music task yields 2 songs, each with audio_url (direct MP3 link, downloadable or streamable), cover image_url, title, text (lyrics; [Instrumental] for instrumentals), and metadata.tags.

Submitting a lyrics task

curl · lyrics
curl https://www.salpx.com/suno/submit/LYRICS \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"A Chinese song about an old lighthouse by the sea"}'

Lyrics tasks also return a task_id first, polled via /suno/fetch; when done, data.clips holds 2 lyric drafts — body in text, title in title (an empty audio_url is expected).

Billing

  • Per-call billing: suno_music ¥0.09/call (yields 2 songs, no surcharge), suno_lyrics ¥0.01/call (yields 2 drafts).
  • Pre-deducted on submit; failed tasks are fully auto-refunded; the fetch endpoint is free.
  • Effective price = base price × the token's group ratio — groups differ; the model square is authoritative.
🎵 Currently available: song generation (vocals / instrumental) and lyric generation — 2 models covering the default, vip, 大额优惠, 内部使用, and 天津专用 groups; other groups get "no available channel". Not yet available: extend, cover, advanced stem split, MIDI, WAV export, music video, vocal removal, and other derivatives — they require audio upload, which the current endpoints do not accept.
Generated files stay upstream for about 14 days — copy audio_url / image_url to your own object storage in time; links die after that and SalpX cannot re-issue them.

08Apps & Skills

SalpX speaks the OpenAI API spec, so mainstream AI apps and clients can use it as their model backend directly. Most apps take three steps: enter the API base URL https://www.salpx.com/v1, enter your API key, pick a model name.

Apps that plug in directly (examples)

Cherry StudioOpenClawLangBot AstrBotClineDeepChat Claude CodeCodex CLIOpenAI-compatible clients

Any client that supports a "custom OpenAI endpoint" works: point the service URL at SalpX and use a SalpX key.

Codex setup (CLI, recommended)

Wiring OpenAI Codex to SalpX takes two files, both under ~/.codex/ (Windows: C:\Users\<username>\.codex\). Easiest: copy the one-line setup command for your system from "Console → Token management" — it fills in everything below; manual setup follows.

The Codex desktop app fails with "unable to set up non-admin sandbox" on some Windows machines (an app-side issue no config can fix) — use the CLI instead: npm install -g @openai/codex.

① ~/.codex/config.toml

config.toml
model_provider = "salpx"
model = "gpt-5.6-luna"
model_reasoning_effort = "high"
preferred_auth_method = "apikey"
approval_policy = "never"
sandbox_mode = "danger-full-access"

[model_providers.salpx]
name = "SalpX"
base_url = "https://www.salpx.com/v1"
wire_api = "responses"
requires_openai_auth = true

Top-level keys (model_provider etc.) must come before every [ ] table, or they get absorbed into the following table and go unread; wire_api must be "responses" (chat is no longer supported); sandbox_mode bypasses the sandbox-init error.

② ~/.codex/auth.json

auth.json
{ "OPENAI_API_KEY": "sk-your-salpx-token" }

③ Apply & verify: fully quit and reopen the terminal / Codex (not just minimize) so the config reloads. Run codex, ask anything, and a normal reply means success; or verify connectivity with curl first:

curl · verify
curl -s https://www.salpx.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.6-luna","messages":[{"role":"user","content":"Reply OK"}],"max_tokens":10}'

Available models: change model to whatever you need, e.g. gpt-5.6-sol (strongest); the full list lives in /v1/models and the model square. Common issues: 401 — check the key is correct and not disabled; no model permission — switch to a model present in /v1/models; no effect — confirm the path, a full restart, and model_provider at the top of the file; Windows — files must be UTF-8 without BOM (use VS Code, not Notepad), and if npm blocks scripts run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned.

Claude Code setup

Install with npm install -g @anthropic-ai/claude-code, set three environment variables, then open a new terminal and run claude: ANTHROPIC_BASE_URL=https://www.salpx.com (no /v1 — the client appends /v1/messages itself; adding it yields /v1/v1 and a 404), ANTHROPIC_AUTH_TOKEN=your-token, ANTHROPIC_MODEL=claude-…. Or just use the one-line command from Token management.

Skills (managed inside AI editors)

SalpX builds on New API and supports its Skills capability: inside AI coding agents like Claude Code, Codex, and OpenClaw you can list models, manage tokens, and check groups and balances without opening the admin console.

To keep everything on-site, this page links out to nothing third-party; app and tool names above are compatibility notes only — point their "API address / Base URL" at https://www.salpx.com/v1 and you are done.

09Management endpoints

For platform configuration, users, channels, models, tokens, redemption codes, payments, and logs (mostly the site's own admin backend). 17 endpoint families:

01
System
System info and status.
GET/api/status
02
Options
System configuration.
GET/api/option
03
User auth
Login, registration, password management.
POST/api/user/login
04
User management
User profile management.
GET/api/user/self
05
2FA
Two-factor authentication.
GET/api/user/2fa/status
06
OAuth
Third-party OAuth login.
GET/api/oauth/github
07
Channels
API channel configuration.
GET/api/channel
08
Models
Model configuration.
GET/api/models
09
Tokens
API token management.
GET/api/token
10
Redemption codes
Redemption code management.
GET/api/redemption
11
Payments
Payment and top-up.
GET/api/user/topup
12
Logs
Usage log queries.
GET/api/log
13
Analytics
Usage statistics.
GET/api/data
14
Tasks
Async task management.
GET/api/task
15
Groups
User group management.
GET/api/group
16
Vendors
Vendor management.
GET/api/vendors
17
Security verification
Security verification endpoints.
GET/api/verify/status

10Models & billing

  • Pay-as-you-go: text models bill per token (input + output).
  • Per-call: images, video, etc. bill a fixed price per call (video by fixed duration, e.g. 10s / 15s).
  • Each group maps to different channels/prices; see the model square for available models and live prices.

11Error codes

HTTPcodeMeaningWhat to do
400invalid_requestBad request parameters (e.g. image-to-image missing image_url, unsupported fields)Fix the request per the returned message
401invalid_api_key / APIKEY_USER_NOT_FOUNDKey invalid, disabled, or upstream relay key mismatchCheck the key in the console; if calling via your own relay, check its base_url / auth header
403insufficient_quotaToken quota exhausted or token cappedTop up in the console or raise the token quota
404model_not_found / model_price_errorModel missing, unavailable in your group, or unpricedCheck the model name / token group; model_price_error is caught before billing — no charge
429rate_limit_exceededConcurrency or rate limit hitLower concurrency or retry with exponential backoff
500do_request_failedUpstream connection failure (DNS / TLS / refused); SalpX retries internallyFailures are auto-refunded; switch models or retry later
502upstream_error / no_resultUpstream error / async generation finished without a URLFailures are auto-refunded; retry or switch models
504gateway_timeoutAsync task exceeded the max wait (video cap ~20 minutes)Failures are auto-refunded; retry off-peak
Refund guarantee: every upstream-side failure (5xx family) is treated as failed and auto-refunded by SalpX — you will never be billed for a result you did not get. model_price_error is caught before billing, so it never charges either.

12Rate limits & groups

  • Tokens bind to a group, which decides available models and pricing; the auto group picks the best option by priority.
  • Concurrency and rate limits are visible in the console; hitting a limit returns rate_limit_exceeded.
  • Reuse one key per capability and handle retries and timeouts server-side.

13SDK examples & batch calls

SalpX is fully OpenAI-SDK compatible — point base_url at https://www.salpx.com/v1, put a SalpX token in api_key, and every model family is callable (chat, images, video; video uses the async task endpoints, see Section 06).

Python (official openai SDK)

pip install openai
from openai import OpenAI

client = OpenAI(
    api_key="sk-…",
    base_url="https://www.salpx.com/v1",
)

resp = client.chat.completions.create(
    model="gpt-5.6-sol",
    messages=[{"role": "user", "content": "Write quicksort in Python"}],
    timeout=120,
)
print(resp.choices[0].message.content)

Images / video work the same way: swap client.chat.completions for client.images.generate (images, see the XY series in Section 06) or create + poll tasks on /v1/videos (video, see Section 05); base_url and the token stay unchanged.

Node.js (openai SDK)

npm i openai
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "sk-…",
  baseURL: "https://www.salpx.com/v1",
  timeout: 120000,
});

const resp = await client.chat.completions.create({
  model: "gpt-5.6-sol",
  messages: [{ role: "user", content: "Write quicksort in Python" }],
} as any);

console.log(resp.choices[0].message.content);

Go (raw net/http)

No third-party dependencies
package main

import (
  "bytes"; "fmt"; "io"; "net/http"; "time"
)

func main() {
  body := []byte(`{"model":"gpt-5.6-sol","messages":[{"role":"user","content":"Write quicksort in Python"}]}`)
  req, _ := http.NewRequest("POST", "https://www.salpx.com/v1/chat/completions", bytes.NewReader(body))
  req.Header.Set("Authorization", "Bearer sk-…")
  req.Header.Set("Content-Type", "application/json")
  cli := &http.Client{Timeout: 120 * time.Second}
  resp, _ := cli.Do(req)
  defer resp.Body.Close()
  data, _ := io.ReadAll(resp.Body)
  fmt.Println(string(data))
}

Batch calling

Video tasks often take tens of seconds to minutes — serial calls crush your throughput. Go concurrent (per-token concurrency cap 5–10; contact SalpX to raise it):

Python · asyncio.gather
import asyncio
from openai import AsyncOpenAI

client = AsyncOpenAI(
    api_key="sk-…",
    base_url="https://www.salpx.com/v1",
    timeout=120,
)

async def gen(prompt):
    r = await client.chat.completions.create(
        model="gpt-5.6-sol",
        messages=[{"role": "user", "content": prompt}],
    )
    return r.choices[0].message.content

async def main():
    prompts = ["Write quicksort in Python", "Explain the TCP three-way handshake", "Write a regex that matches emails"]
    results = await asyncio.gather(
        *[gen(p) for p in prompts],
        return_exceptions=True,  # one failure doesn't sink the batch
    )
    for r in results:
        print(r)

asyncio.run(main())

Implementation notes

  • Failure handling: upstream errors (5xx) are auto-refunded by SalpX. Your client only needs to catch exceptions — no "billed but no result" compensation logic required.
  • Timeouts: client timeout ≥ 120s (images) or ≥ 600s (video); SalpX polls upstream for up to 20 minutes, then returns 504 with a refund.
  • Concurrency cap: ≤ 10 concurrent per token by default; exceeding it returns 429 rate_limit_exceeded — back off or request a raise.
  • Reconciliation: the response usage carries the task ID for your billing reconciliation.
  • Extracting results: images — take data[0].b64_json (or data[0].url) straight from /v1/images/generations; video — poll /v1/videos/<id>, take the video URL from the final response, then download the bytes via /v1/videos/<id>/content.

14CLI tools

Rule of thumb: HTTP / SDK / most clients use https://www.salpx.com/v1; Claude Code, Gemini CLI, and Codex CLI use the root https://www.salpx.com (no /v1). Restart the terminal / process after changing config.

Claude Code

Point the environment variables at the root (no /v1), then restart the terminal.

shell
export ANTHROPIC_BASE_URL="https://www.salpx.com"
export ANTHROPIC_AUTH_TOKEN="YOUR_KEY"
export ANTHROPIC_MODEL="claude-opus-4-8"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1

Apps launched from the macOS Dock do not inherit shell variables — put the three lines above into the env field of ~/.claude/settings.json.

Gemini CLI

Point Gemini CLI at the root address.

shell
export GOOGLE_GEMINI_BASE_URL="https://www.salpx.com"
export GEMINI_API_KEY="YOUR_KEY"
export GEMINI_MODEL="gemini-3.5-flash"

Codex CLI

Define a custom provider in ~/.codex/config.toml and put the key in ~/.codex/auth.json.

~/.codex/config.toml
model_provider = "salpx"
model = "gpt-5.6-luna"
disable_response_storage = true
network_access = "enabled"

[model_providers.salpx]
name = "SalpX"
base_url = "https://www.salpx.com"
wire_api = "responses"
requires_openai_auth = true
~/.codex/auth.json
{ "OPENAI_API_KEY": "YOUR_KEY" }

Codex one-line install

One script installs the Codex CLI and wires it to SalpX — works for both the ChatGPT Codex desktop app and the CLI.

⚠️ Replace testkey in the script with your own SalpX key (from the console) before running.
install-codex.sh
#!/usr/bin/env bash
set -euo pipefail

# ⚠️ Replace testkey with your own SalpX key
SALPX_KEY='testkey'

CODEX_DIR="$HOME/.codex"
mkdir -p "$CODEX_DIR"

if command -v npm >/dev/null 2>&1; then
  npm install -g @openai/codex || echo "Codex CLI install failed; run manually: npm install -g @openai/codex"
else
  echo "npm not found. The CLI needs Node.js LTS first (nodejs.org); ignore if you only use the desktop app."
fi

[ -f "$CODEX_DIR/config.toml" ] && cp "$CODEX_DIR/config.toml" "$CODEX_DIR/config.toml.bak.$(date +%Y%m%d%H%M%S)"
[ -f "$CODEX_DIR/auth.json" ] && cp "$CODEX_DIR/auth.json" "$CODEX_DIR/auth.json.bak.$(date +%Y%m%d%H%M%S)"

cat > "$CODEX_DIR/config.toml" <<'EOF'
model_provider = "salpx"
model = "gpt-5.6-luna"
model_reasoning_effort = "high"
preferred_auth_method = "apikey"

[model_providers.salpx]
name = "SalpX"
base_url = "https://www.salpx.com/v1"
wire_api = "responses"
EOF
chmod 600 "$CODEX_DIR/config.toml"

printf '{\n    "auth_mode": "apikey",\n    "OPENAI_API_KEY": "%s"\n}\n' "$SALPX_KEY" > "$CODEX_DIR/auth.json"
chmod 600 "$CODEX_DIR/auth.json"

echo "SalpX Codex config done ($CODEX_DIR). Fully quit and restart Codex / the terminal."
[ "$SALPX_KEY" = "testkey" ] && echo "Warning: still the placeholder testkey — edit ~/.codex/auth.json with your own key."

Save as install-codex.sh and run bash install-codex.sh, or paste it straight into a terminal.

15Desktop & clients

CC-Switch

A Claude Code endpoint switcher. Map each provider group to its client and URL as below:

Mapping
OpenAI            → Codex        → https://www.salpx.com
Anthropic/Claude  → Claude Code  → https://www.salpx.com
Gemini            → Gemini CLI   → https://www.salpx.com

OpenCode

Add a custom provider in opencode.json.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "openai": {
      "options": {
        "baseURL": "https://www.salpx.com/v1",
        "apiKey": "YOUR_KEY"
      }
    }
  }
}

OpenClaw

Define a custom provider in ~/.openclaw/openclaw.json; put the key in the env block.

~/.openclaw/openclaw.json
{
  "env": { "SALPX_API_KEY": "YOUR_KEY" },
  "agents": {
    "defaults": { "model": { "primary": "salpx/gpt-5.6-luna" } }
  },
  "models": {
    "mode": "merge",
    "providers": {
      "salpx": {
        "baseUrl": "https://www.salpx.com/v1",
        "apiKey": "${SALPX_API_KEY}",
        "api": "openai-responses",
        "models": [{ "id": "gpt-5.6-luna", "name": "GPT-5.6 Luna" }]
      }
    }
  }
}

Hermes

Configure via ~/.hermes/config.yaml, or interactively with hermes model.

~/.hermes/config.yaml
model:
  default: gpt-5.6-luna
  provider: custom
  base_url: https://www.salpx.com/v1
  api_key: YOUR_KEY

Cherry Studio

A desktop LLM client — add a custom OpenAI provider:

  • Settings → Model services → Add custom provider
  • API key: YOUR_KEY
  • API address: https://www.salpx.com/v1 (stop at /v1; the rest is auto-completed)
  • Add the model ID manually (e.g. gpt-5.6-luna), then hit "Check connection"

WorkBuddy

Add models in ~/.codebuddy/models.json using the full endpoint path, saved as UTF-8 without BOM.

~/.codebuddy/models.json
{
  "models": [
    {
      "id": "gpt-5.6-luna",
      "name": "GPT-5.6 Luna (SalpX)",
      "vendor": "OpenAI",
      "url": "https://www.salpx.com/v1/chat/completions",
      "apiKey": "YOUR_KEY",
      "maxInputTokens": 128000,
      "maxOutputTokens": 8192,
      "supportsToolCall": true
    }
  ],
  "availableModels": ["gpt-5.6-luna"]
}

DeskClaw

DeskClaw is a desktop wrapper around OpenClaw with built-in models and no obvious "custom endpoint" entry in its UI. If your version reads the standard OpenClaw config, the OpenClaw method above (~/.openclaw/openclaw.json) works.

Unofficial item — verify with your DeskClaw version whether it reads ~/.openclaw/openclaw.json.

Trae

ByteDance's AI IDE. Note: Trae currently does not support custom base URLs (only its built-in provider list), so you cannot enter the SalpX address directly like in other clients. Two options:

  • Local proxy (works today): use the open-source Trae-Proxy (search GitHub for arch3rPro/Trae-Proxy) to intercept Trae's OpenAI-bound requests and forward them to SalpX. Steps: ① start Trae-Proxy with the backend set to https://www.salpx.com/v1 and your SalpX key; ② install its self-signed certificate; ③ edit your hosts file per its instructions to point the OpenAI domain at the local proxy; ④ back in Trae → add model → provider OpenAI → custom model ID (e.g. gpt-5.6-luna).
  • Native (version-dependent): if your Trae version exposes "custom endpoint / base URL", just enter https://www.salpx.com/v1 + your SalpX key + a model name.
This is a Trae-side product limitation, not a SalpX one — SalpX is fully OpenAI-compatible, so the moment Trae supports custom endpoints it works with zero changes.
⚠️ Debugging mid-stream drops: with Trae-Proxy, a Stream error: Transport error: request or response body error (origin:downstream) is usually not a model or SalpX fault (tokens are still generating) — it is the local proxy layer. Check in order: ① is Trae-Proxy buffering SSE — a local proxy that does not stream through in real time gets long answers / thinking models killed by idle timeouts (prime suspect); ② raise Trae-Proxy and Trae request / stream timeouts: idle (read) timeout ≥ 120 s, whole request ≥ 600 s (if there is only one timeout setting, use 300–600 s); ③ if another reverse proxy (nginx etc.) sits in the path, add proxy_buffering off so streams pass through live. The SalpX gateway has built-in SSE idle keep-alive heartbeats (admin-enabled) that absorb some idle timeouts.

16Advanced · Enabling the Codex plugin (Codex++)

  1. Install the official Codex app, then install Codex++ from its releases.
  2. Create / copy an API key in the console.
  3. Open the Codex++ tool → Relay configuration.
  4. Add a config: Base URL https://www.salpx.com/v1, API key, model gpt-5.6-luna.
  5. Save, launch Codex via Codex++, and confirm Provider = CodexPlusPlus.

17Help

FAQ

SymptomFix
401 / invalid_api_keyCopy the full key from the console — no stray spaces or newlines.
403Insufficient balance, a disabled key, or the model is not in your group.
404Wrong address / path. HTTP/SDK use /v1; Claude Code & Gemini CLI use the root.
CC-Switch import does nothingConfirm CC-Switch is installed and the ccswitch:// protocol is registered.
CLI changes have no effectRestart the process; environment variables only apply to new sessions.

Get access

Create an API key under Console → Token management, top up, and every model is callable. One key works across all endpoints and clients.