PineRouterDocs
GuidesModelsAPI referenceApps

Text to speech

POST
/v1/audio/speech

Authorization

BearerAuth

AuthorizationBearer <token>

Bearer token authentication. Format: Authorization: Bearer sk-xxxxxx

In: header

Request Body

application/json

model*string
input*string

Text to convert

Lengthlength <= 4096
voice*string
Value in"alloy" | "echo" | "fable" | "onyx" | "nova" | "shimmer"
response_format?string
Default"mp3"
Value in"mp3" | "opus" | "aac" | "flac" | "wav" | "pcm"
speed?number
Default1
Range0.25 <= value <= 4

Response Body

audio/mpeg

application/json

application/json

application/json

application/json

curl -X POST "https://pinerouter.ai/v1/audio/speech" \  -H "Content-Type: application/json" \  -d '{    "model": "tts-1",    "input": "string",    "voice": "alloy"  }'
"string"
{
  "error": {
    "code": "",
    "message": "Invalid token (request id: 20261102053704107200635868d9d6m7EOL5JK)",
    "type": "api_error"
  }
}
{
  "error": {
    "code": "",
    "message": "This token has no access to model gpt-5-2 (request id: 20261102053704107200635868d9d6m7EOL5JK)",
    "type": "api_error"
  }
}
{
  "error": {
    "code": "",
    "message": "You have reached the request limit: maximum 60 requests in 1 minutes (request id: 20261102053704107200635868d9d6m7EOL5JK)",
    "type": "api_error"
  }
}
{
  "error": {
    "code": "bad_response_status_code",
    "message": "bad response status code 500 (request id: 20261102053704107200635868d9d6m7EOL5JK)",
    "type": "api_error",
    "param": ""
  }
}