Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: Nano Studio Pro Sounds API
version: 1.0.0
description: 'Programmatic access to **Nano Studio Pro** — generate AI fashion and product photography, manage projects and assets, and track storage from any client (scripts, CLIs, AI agents).
### How it works
You group your work into **Projects**. Each generation belongs to a project. Reusable inputs (model photos, pose references, uploads) live in **Assets** and can be passed by ID into any generation. Generations cost credits by resolution (see `POST /v1/generations`); asset uploads count against your **storage quota**.
### Authentication
All requests require a Bearer token. Create one at Settings · API keys. The token is shown once at creation — store it safely. If lost, revoke and create a new one.
```bash
curl -H "Authorization: Bearer sk_sf_live_..." https://nanostudiopro.com/api/v1/me
```
Two kinds of key share this header:
- **Secret keys** (`sk_sf_live_...`) — full API access, governed by the token''s scopes. Never ship one in client-side code.
- **Publishable keys** (`pk_sf_live_...`) — safe to embed in public HTML. They are created with the `read` scope only and work **exclusively on `GET /v1/search`**: authentication itself rejects them with `401 unauthorized` on every other endpoint. Each publishable key optionally carries a **`search_scope`** object (see the schema of that name) that narrows what it can see:
- `projects` — the key sees only these project ids; absent = the whole library.
- `types` — result types the key may return (`asset` / `generation`).
- `max_image_size` — caps the `image_size` variant served; requests above the cap (the `preview` default included) are silently served the cap.
- `origins` — exact-match browser `Origin` allowlist; a request from any other origin gets `403 forbidden`. Absent = any origin. Requests with no Origin header (curl, server-to-server) always pass — the origin lock is a soft, browser-only control; the hard controls are the read-only scope and the narrowing above.
- `include_regions` — whether the key may request detection regions. Default false.
- `include_narrative` — whether results carry the AI-written photo description (`narrative`). Default false: publishable-key results omit it unless the scope opts in.
Scope narrowing is **silent by design**: a filter that falls entirely outside the key''s scope returns an empty 200 page, never an error, so a client can''t probe what exists outside its window.
### Rate limits
Per-token rate limits are enforced; when exceeded you''ll get `429` with a `Retry-After` header. Secret keys get **60 requests/min per token**. Publishable keys (search-only) get **600/min per key** plus **60/min per key + client IP** — whichever is stricter wins, so one hot visitor can''t exhaust a whole site''s key. Search rate limits are durable — shared across server instances, so counts don''t reset on deploys or split between replicas.
### Errors
All error responses use the same shape: `{ "error": { "code": "...", "message": "..." } }`. Common codes include `unauthorized`, `validation_error`, `not_found`, `insufficient_credits`, `token_cap_exceeded`, `storage_limit_exceeded`, `rate_limited`.
## Authorizing a device
Two ways to get a token:
1. **Manual** — create one in Settings · API Tokens. Returns a `sk_sf_live_...` token immediately.
2. **Device flow (RFC 8628)** — for CLIs and headless tools. Run `curl -fsSL https://nanostudiopro.com/cli/nsp -o /usr/local/bin/nsp && chmod +x /usr/local/bin/nsp && nsp login`, or implement the protocol yourself (full walkthrough at /docs/device-auth; endpoints are listed under the **Device Auth** tag below).
Each token can optionally have a **daily credit cap** — a rolling-24h spending limit independent of the wallet balance. Useful for limiting blast radius if a token leaks. Configure under Settings → API Tokens.'
contact:
url: https://nanostudiopro.com/settings?tab=api-tokens
servers:
- url: /api
description: Same origin as docs (auto-detects local vs prod)
- url: https://nanostudiopro.com/api
description: Production
security:
- BearerAuth: []
tags:
- name: Sounds
description: 'The user''s sound library: every music track, sound effect, ambience and voice the app has made or been given, from any section (storyboards, clips, Motion Studio, uploads), each named, categorised and tagged when it is saved. Read it to reuse a sound instead of paying for a new one; each sound carries a signed `url` to its file. Make one from words with `POST` (costs credits; `dry_run` quotes) or add a file with `POST /v1/sounds/upload` (free but for storage). Rename, recategorise, retag or hide one with `PATCH`; there is no delete, because any document may be using the file.'
paths:
/v1/sounds:
get:
tags:
- Sounds
summary: Search the sound library
description: 'Your sounds, newest first — or best match first with `q`, which searches each sound''s name, words and tags. Every filter is strict: an unknown `kind`, `category` or `language` is a `400`, never a silent "everything". Hidden sounds are left out unless `hidden=true`. Free.'
parameters:
- name: q
in: query
description: Words to match against name, prompt or transcript, and tags.
schema:
type: string
example: rain
- name: kind
in: query
description: One or more kinds, comma-separated.
schema:
type: string
example: ambience,sfx
- name: category
in: query
description: One category (see `Sound.category`); with `kind`, it must be one of those kinds' categories.
schema:
type: string
example: weather
- name: language
in: query
description: BCP-47 code; matches by base language (`es` finds `es-MX`).
schema:
type: string
example: es
- name: project
in: query
description: 'A project id: sounds made in it or used by one of its documents.'
schema:
type: string
- name: hidden
in: query
description: '`true` includes hidden sounds.'
schema:
type: boolean
default: false
- name: limit
in: query
description: How many to return.
schema:
type: integer
minimum: 1
maximum: 100
default: 20
responses:
'200':
description: The matching sounds, up to `limit`.
content:
application/json:
schema:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/Sound'
total:
type: integer
description: How many came back (not the size of the library).
'400':
description: '`kind` takes music, sfx, ambience, voice (comma-separated); got noise'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: validation_error
message: '`kind` takes music, sfx, ambience, voice (comma-separated); got noise'
'401':
description: Missing or invalid token
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: unauthorized
message: Missing or invalid token
'429':
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: rate_limited
message: Rate limit exceeded
operationId: getV1Sounds
x-operation-id-source: derived
post:
tags:
- Sounds
summary: Make a sound from words (costs credits)
description: 'Makes one sound into your library with ElevenLabs, the same render and price as the Sounds page: music (`prompt`, 3-300 s, default 30), a sound effect (`prompt`, 0.5-22 s, default 3), an ambience (a long effect, default 15 s) or a voice line (`script`, said verbatim, in `voice_id`; default the first studio voice). **Costs credits**: `audio_music_10s` per 10 s of music, `audio_sfx_10s` per 10 s of an effect or ambience, `audio_voice_100char` per 100 characters of a line (see `/v1/pricing`). Quote first with `dry_run: true`: free, nothing made, `credits` plus `seconds` or `characters`, and for a voice line `voices`, the voice ids on offer. Without `dry_run` it answers `201` with the sound, `credits_charged` and `task_id`, charged through your token so its daily cap applies. Paid tier only (`402 audio_requires_purchase` on trial credits).'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- kind
properties:
kind:
type: string
enum:
- music
- sfx
- ambience
- voice
prompt:
type: string
maxLength: 2000
description: What it should sound like (music, sfx, ambience). For a voice line without `script`, read as the line.
example: Slow solo piano, rain on the window
script:
type: string
maxLength: 2000
description: 'voice: the words, said verbatim.'
seconds:
type: number
description: music 3-300 (default 30); sfx 0.5-22 (default 3); ambience up to 22 (default 15). Out of range is clamped. Ignored for voice.
voice_id:
type: string
description: 'voice: one of the `voices` a dry_run lists; an unknown id falls back to the default voice.'
dry_run:
type: boolean
description: 'Quote only: nothing made or charged.'
responses:
'200':
description: The quote (dry_run)
content:
application/json:
schema:
type: object
properties:
dry_run:
type: boolean
status:
type: string
example: quote
credits:
type: integer
kind:
type: string
seconds:
type: number
description: music, sfx, ambience
characters:
type: integer
description: voice
voice_id:
type: string
description: voice
voices:
type: array
description: voice
items:
type: object
properties:
id:
type: string
name:
type: string
note:
type: string
'201':
description: The sound as made
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Sound'
- type: object
properties:
credits_charged:
type: integer
task_id:
type: string
'400':
description: Describe the sound (prompt).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: validation_error
message: Describe the sound (prompt).
'401':
description: Missing or invalid token
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: unauthorized
message: Missing or invalid token
'402':
description: Audio needs purchased credits
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: audio_requires_purchase
message: Audio needs purchased credits
'429':
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: rate_limited
message: Rate limit exceeded
operationId: postV1Sounds
x-operation-id-source: derived
/v1/sounds/upload:
post:
tags:
- Sounds
summary: Add an audio file to the sound library
description: 'Multipart (`file`, optional `kind`, `name`, `recording=1`) or JSON `{ url, kind?, name?, recording? }` for a public link. MP3, M4A, OGG or WAV, read from the bytes; up to 20 MB. Free, but the file counts toward storage (`402 storage_limit_exceeded` when it does not fit). `recording: true` files it as a voice recording: brought to one loudness and named from what is said (the local MCP server''s `record` sends its microphone takes this way). Otherwise `kind` when given, else listening decides. Every file is listened to, named, categorised and (for speech) transcribed a few seconds after it lands: read it again with `GET /v1/sounds/{id}`.'
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required:
- file
properties:
file:
type: string
format: binary
kind:
type: string
enum:
- music
- sfx
- ambience
- voice
name:
type: string
recording:
type: string
enum:
- '1'
- 'true'
application/json:
schema:
type: object
required:
- url
properties:
url:
type: string
format: uri
description: A public link to the file.
kind:
type: string
enum:
- music
- sfx
- ambience
- voice
name:
type: string
recording:
type: boolean
responses:
'201':
description: The sound as kept; its name and category may still be on the way
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Sound'
- type: object
properties:
task_id:
type: string
note:
type: string
'400':
description: That file is over 20 MB
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: validation_error
message: That file is over 20 MB
'401':
description: Missing or invalid token
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: unauthorized
message: Missing or invalid token
'402':
description: Does not fit in your free space
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: storage_limit_exceeded
message: Does not fit in your free space
'429':
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: rate_limited
message: Rate limit exceeded
operationId: postV1SoundsUpload
x-operation-id-source: derived
/v1/sounds/{id}:
parameters:
- name: id
in: path
required: true
description: Sound ID. Get one from `GET /v1/sounds`.
schema:
type: string
get:
tags:
- Sounds
summary: Get one sound
description: One of your sounds, hidden or not, with a fresh signed `url`. Somebody else's id answers `404`, not `403`. Free.
responses:
'200':
description: The sound
content:
application/json:
schema:
$ref: '#/components/schemas/Sound'
'401':
description: Missing or invalid token
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: unauthorized
message: Missing or invalid token
'404':
description: Sound not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: not_found
message: Sound not found
'429':
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: rate_limited
message: Rate limit exceeded
operationId: getV1SoundsById
x-operation-id-source: derived
patch:
tags:
- Sounds
summary: Rename, retag or hide a sound
description: The Sounds page's own edit. `category` stays within the sound's kind (an unknown one becomes `other`); `tags` replaces the list (up to 12, lowercased); `language` `null` clears it; `hidden` hides or unhides — there is no delete. Answers the sound as saved. Free.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
maxLength: 60
example: Night rain
category:
type: string
example: weather
tags:
type: array
items:
type: string
example:
- rain
- night
language:
type: string
nullable: true
example: es-MX
hidden:
type: boolean
responses:
'200':
description: The sound as saved
content:
application/json:
schema:
$ref: '#/components/schemas/Sound'
'400':
description: A sound needs a name
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: validation_error
message: A sound needs a name
'401':
description: Missing or invalid token
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: unauthorized
message: Missing or invalid token
'404':
description: Sound not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: not_found
message: Sound not found
'429':
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: rate_limited
message: Rate limit exceeded
operationId: patchV1SoundsById
x-operation-id-source: derived
components:
schemas:
Error:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
properties:
code:
type: string
example: validation_error
message:
type: string
example: '`prompt` is required'
needed:
type: integer
nullable: true
description: '402 only: what the operation costs in credits, when known.'
balance:
type: integer
nullable: true
description: '402 only: what the account has (for `token_cap_exceeded`, what the token may still spend today), when known.'
purchase_url:
type: string
format: uri
description: '402 only: where the person adds credits. Every 402 (`insufficient_credits`, `token_cap_exceeded`, `video_requires_purchase`, `audio_requires_purchase`, `storage_limit_exceeded`, `trial_required`) carries the same fields, so one handler can show the notice. `trial_required` answers an upload from an account that has not started its free trial: nothing was stored, and the upload goes through once the trial is on.'
Sound:
type: object
properties:
id:
type: string
example: cmh2x0q1k0001abcd1234efgh
name:
type: string
example: Night rain on a tin roof
kind:
type: string
enum:
- music
- sfx
- ambience
- voice
category:
type: string
example: weather
description: 'One of the kind''s categories — music: score, song, loop, sting, theme; sfx: impact, whoosh, foley, mechanical, animal, weapon, magic, ui, typing, vehicle, human; ambience: nature, weather, city, interior, crowd, industrial, space; voice: dialogue, voice_over, narration, commentary, recording, audition, isolated; every kind also has `other`.'
source:
type: string
enum:
- generated
- upload
- isolated
- import
language:
type: string
nullable: true
example: es-MX
description: BCP-47 code of any spoken or sung words; `null` when there are none.
tags:
type: array
items:
type: string
example:
- rain
- calm
- night
prompt:
type: string
nullable: true
description: The words it was made from (a prompt, a script) or, for heard speech, the transcript.
duration_ms:
type: integer
example: 12000
credits:
type: integer
description: What making it cost, in credits; 0 for uploads.
url:
type: string
format: uri
description: Signed link to the audio file, fetchable without a token; expires after about 6 hours, so read a fresh one rather than storing it.
origin:
type: object
description: 'Where it was made: the app surface and, when there is one, the document.'
properties:
surface:
type: string
example: clip.soundscape
doc_type:
type: string
nullable: true
example: storyboard
doc_id:
type: string
nullable: true
hidden:
type: boolean
project_count:
type: integer
description: Projects it was made in or is used by.
use_count:
type: integer
description: Documents that use it.
created_at:
type: string
format: date-time
securitySchemes:
BearerAuth:
type: http
scheme: bearer
description: 'Personal access token from `/settings?tab=api-tokens`. Send as `Authorization: Bearer sk_sf_live_...` — or a publishable `pk_sf_live_...` key, which authenticates on `GET /v1/search` only.'