> For the complete documentation index, see [llms.txt](https://docs.otari.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otari.ai/reference/api-reference/audio.md). Agents can also search and read this documentation through its [MCP server](https://docs.otari.ai/~gitbook/mcp).

# Audio

## Create Speech

> OpenAI-compatible audio speech (TTS) endpoint.\
> \
> Billed on the characters of \`\`input\`\` at a rate priced per character, or\
> one request at a rate priced per request. A model with no rate is refused\
> under \`\`require\_pricing\`\`. The body is audio, so the settled cost rides\
> the response headers: \`\`Otari-Cost-USD\`\` and \`\`Otari-Pricing-Source\`\`, the\
> \`\`cost\_usd\`\` and \`\`pricing\_source\`\` other responses carry on \`\`usage\`\`, and\
> \`\`Otari-Usage-Unit\`\` and \`\`Otari-Usage-Units\`\` for the meter billed and\
> its count.\
> \
> Authentication modes:\
> \- Master key + user field: Use specified user (must exist)\
> \- API key + user field: Use specified user (must exist)\
> \- API key without user field: Use the shared "default" user

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.55.1"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"AudioSpeechRequest":{"description":"OpenAI-compatible audio speech (TTS) request.\n\nThe speech fields are derived from any-llm's ``AudioSpeechParams`` (see\n``_schema_derive``) so the schema cannot silently drop a param any-llm\nforwards. ``user`` is gateway-only (billing / auth scoping); it is not an\nany-llm param and is stripped before the request is forwarded.","properties":{"input":{"title":"Input","type":"string"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions"},"model":{"title":"Model","type":"string"},"response_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Format"},"speed":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speed"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"},"voice":{"title":"Voice","type":"string"}},"required":["model","input","voice"],"title":"AudioSpeechRequest","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/audio/speech":{"post":{"description":"OpenAI-compatible audio speech (TTS) endpoint.\n\nBilled on the characters of ``input`` at a rate priced per character, or\none request at a rate priced per request. A model with no rate is refused\nunder ``require_pricing``. The body is audio, so the settled cost rides\nthe response headers: ``Otari-Cost-USD`` and ``Otari-Pricing-Source``, the\n``cost_usd`` and ``pricing_source`` other responses carry on ``usage``, and\n``Otari-Usage-Unit`` and ``Otari-Usage-Units`` for the meter billed and\nits count.\n\nAuthentication modes:\n- Master key + user field: Use specified user (must exist)\n- API key + user field: Use specified user (must exist)\n- API key without user field: Use the shared \"default\" user","operationId":"audio-create_speech","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudioSpeechRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}},"audio/L16":{"schema":{"format":"binary","type":"string"}},"audio/aac":{"schema":{"format":"binary","type":"string"}},"audio/flac":{"schema":{"format":"binary","type":"string"}},"audio/mpeg":{"schema":{"format":"binary","type":"string"}},"audio/opus":{"schema":{"format":"binary","type":"string"}},"audio/wav":{"schema":{"format":"binary","type":"string"}}},"description":"Audio bytes in the requested format","headers":{"Otari-Cost-USD":{"description":"What the request cost, as a six-decimal USD string; absent when it was not priced","schema":{"type":"string"}},"Otari-Pricing-Source":{"description":"Which rate priced it: organization, deployment or defaults; absent when it was not priced","schema":{"type":"string"}},"Otari-Usage-Unit":{"description":"The meter the request was billed on, characters or requests; absent when nothing was billed","schema":{"type":"string"}},"Otari-Usage-Units":{"description":"How many of that meter were billed; absent when nothing was billed","schema":{"type":"integer"}}}},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Create Speech","tags":["audio"]}}}}
```

## Create Transcription

> OpenAI-compatible audio transcription endpoint.\
> \
> Authentication modes:\
> \- Master key + user field: Use specified user (must exist)\
> \- API key + user field: Use specified user (must exist)\
> \- API key without user field: Use the shared "default" user

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.55.1"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/audio/transcriptions":{"post":{"description":"OpenAI-compatible audio transcription endpoint.\n\nAuthentication modes:\n- Master key + user field: Use specified user (must exist)\n- API key + user field: Use specified user (must exist)\n- API key without user field: Use the shared \"default\" user","operationId":"audio-create_transcription","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"contentMediaType":"application/octet-stream","title":"File","type":"string"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"model":{"title":"Model","type":"string"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"response_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Format"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"}},"required":["file","model"],"title":"Body_audio-create_transcription","type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"},"413":{"description":"The audio upload exceeds the maximum request size."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Create Transcription","tags":["audio"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.otari.ai/reference/api-reference/audio.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
