Skip to content
IntroducingSPEV, the first audio-in decision modelRead the launch →
SPEV, the first audio-in decision model →
sprag

MCP

Connect an AI assistant to Sprag through MCP and call speech, transcription, voice, and decision models as tools.

The Sprag MCP server lets an AI assistant call the Sprag API as tools over the Model Context Protocol. The assistant can generate speech, transcribe a recording, design and create voices, and ask Decisions questions on your behalf.

Connect

Add a remote MCP server in your client with this URL:

https://api.sprag.ai/mcp

The first connection asks you to sign in with your Sprag account and approve access.

The connection acts under your default workspace. Tool calls draw on that workspace's credits and use its voices, the same as a request made with one of its API keys.

To connect another workspace, switch to it in the app and copy its URL from API keys.

To check the connection, ask the assistant to list the Sprag models.

Example

Asked to read a sentence aloud, the assistant calls list_voices to find a voice, then calls generate_speech:

{
  "model": "chorus",
  "voice": "marin",
  "input": "Hello from Sprag.",
  "response_format": "wav"
}

The result carries the audio inline, along with its MIME type and size in bytes.

Tools

Each tool sends one request to the endpoint in its row and returns the completed response. The client receives the full input schema of every tool when it connects.

ToolEndpointReturns
list_modelsGET /v1/modelsThe model catalog
list_voicesGET /v1/audio/voicesPreset voices and your workspace's voices, one page at a time
generate_speechPOST /v1/audio/speechAudio
transcribe_audioPOST /v1/audio/transcriptionsA transcript, with timestamps and speaker labels when requested
translate_audioPOST /v1/audio/translationsTranslated text
create_chat_completionPOST /v1/chat/completionsA completion, including any tool calls the model made
evaluate_decisionsPOST /v1/decisionsOne answer per question, with probabilities
detect_turnPOST /v1/turnsAn end-of-turn probability and decision
fingerprint_voicePOST /v1/audio/voices/fingerprintA voice fingerprint
design_voicePOST /v1/audio/voices/designAudio previews, each with a design_id and expires_at
create_voicePOST /v1/audio/voicesA voice in your workspace
delete_voiceDELETE /v1/audio/voices/{voice_id}The deletion result

A tool accepts the same fields as its endpoint. list_models, list_voices, generate_speech, and transcribe_audio take those fields as top-level arguments. The other tools take them in a request object, except delete_voice, which takes voice_id.

create_chat_completion returns the model's tool calls to the assistant without running them.

Send a recording

Tools that take a recording accept it as base64 in audio_base64, with a filename that carries the file's extension:

{
  "model": "rhythm",
  "audio_base64": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQAAAAA=",
  "filename": "recording.wav"
}

To produce the value from a file on disk, run base64 < recording.wav | tr -d '\n'.

Create a voice

To create a voice from a description, call design_voice, listen to the previews, then call create_voice with a name and the chosen preview's design_id before its expires_at.

To clone a speaker, call create_voice with a name, a model, the reference recording in audio_base64 and filename, and its transcript in ref_text. A voice comes from either a recording or a design_id, not both.

delete_voice permanently deletes a voice from your workspace.

Constraints

  • generate_speech, transcribe_audio, translate_audio, create_chat_completion, evaluate_decisions, detect_turn, fingerprint_voice, design_voice, and create_voice are billed like the endpoints they call.
  • If a tool call times out, the request may already be billed. Calling the tool again sends a new request.
  • Every tool returns a completed response. Streaming output and realtime sessions are available through the API.
  • Model and voice ids come from list_models and list_voices.

Errors

If the API refuses a tool call, the tool returns an error whose message names the HTTP status.

StatusMeaning
400A field was missing, malformed, or out of range. Check the tool's input schema and the model's supported parameters.
401The client is not signed in, or its authorization expired. Reconnect the server in your client and sign in again.
402Your workspace is out of credit. Add credit in Billing.
404The model, voice, or design_id does not exist, or the preview passed its expires_at.
429Your workspace is rate limited. Wait, then ask the assistant to try again.

Next steps

For the fields each tool accepts, see the endpoint pages for text to speech, speech to text, voice design, voice cloning, and Decisions.