{"openapi":"3.0.0","info":{"title":"OPENAPI SERVICE UNIT","description":"Custom OpenAPI Schema","version":"2"},"paths":{"/openapi/v1/estimate":{"post":{"summary":"Price a V1 / V2 text (free, no key)","description":"Points a V1 / V2 text will cost through the API and in Studio, not subscribed (`points`, `studio_points`) and\nas a subscriber (`points_subscriber`, `studio_points_subscriber`). Free, no key needed; with a key the answer also\nsays `subscriber` and `your_points`. Priced by the same function the make charges (services/v12_price.py).","operationId":"estimate_v12_openapi_v1_estimate_post","parameters":[{"name":"Botnoi-Token","in":"header","required":false,"schema":{"type":"string","description":"Optional: your API key, to see your own price","title":"Botnoi-Token"},"description":"Optional: your API key, to see your own price"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateV12Request"},"example":{"text":"สวัสดีครับ","speaker":"8","version":"v2"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{},"example":{"points":2,"points_subscriber":1,"studio_points":20,"studio_points_subscriber":10,"characters":10,"speaker_price":2,"version":"v2","speaker":"8"}}}},"404":{"description":"Unknown speaker id for this version","content":{"application/json":{"example":{"message":"Speaker not found"}}}},"422":{"description":"Empty text, over 20,000 characters, or a version other than v1 / v2","content":{"application/json":{"example":{"message":"version must be v1 or v2 (use /estimate_v4 for V4)"}}}}}}},"/openapi/v1/prices":{"get":{"summary":"Today's prices per letter (free, no key)","description":"Current price per character, read from the code that charges (V1/V2 here, V4 from the voice service).\nFree, no key, never cached, so agents and llms.txt readers always see today's price.","operationId":"prices_openapi_v1_prices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/openapi/v1/generate_audio":{"post":{"tags":["genvoice_v1"],"summary":"Speech with a V1 voice (paid: 0.1 points per letter, 0.05 for subscribers)","operationId":"generate_voice_v1_openapi_v1_generate_audio_post","parameters":[{"name":"Botnoi-Token","in":"header","required":false,"schema":{"type":"string","description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)","title":"Botnoi-Token"},"description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateVoiceQueueRequest"},"example":{"text":"สวัสดีครับ","speaker":"1","volume":1,"speed":1,"type_media":"mp3","save_file":"true","streaming":false,"language":"th","page":"user"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{},"example":{"text":"สวัสดีครับ","audio_url":"https://.../example.mp3","point":6534,"user_monthly_point":0}}}},"401":{"description":"No API key (send Botnoi-Token: <key> or Authorization: Bearer <key>), or a key that is not valid","content":{"application/json":{"examples":{"missing_key":{"summary":"No key sent","value":{"message":"Missing API key. Send your key in the header Botnoi-Token: <key> (Authorization: Bearer <key> also works). Get a key at https://voice.botnoi.ai/developer/api (new accounts get 2,000 free points)."}},"invalid_key":{"summary":"Key not valid","value":{"message":"Please get new token on https://voice.botnoi.ai/developer/api"}}}}}},"403":{"description":"Empty text, or a private voice of another account","content":{"application/json":{"example":{"message":"This voice is private"}}}},"404":{"description":"Not enough points (V1 / V2 answer 404 for this), or no account for the key","content":{"application/json":{"example":{"message":"Not enough credits!"}}}},"422":{"description":"Text longer than 500 characters","content":{"application/json":{"example":{"message":"Text is longer than 500 characters"}}}},"502":{"description":"The voice engine failed; no points taken","content":{"application/json":{"example":{"message":"Voice service error, please try again"}}}},"504":{"description":"No answer within 60 s","content":{"application/json":{"example":{"message":"Request timeout (60s exceeded)"}}}},"400":{"description":"The body is not UTF-8 JSON (e.g. Thai text sent in another encoding)","content":{"application/json":{"example":{"message":"The request body is not valid JSON. Send UTF-8 JSON with Content-Type: application/json (Thai text: make sure your tool sends UTF-8; on Windows write the body to a UTF-8 file and send it with --data-binary @file).","detail":"The request body is not valid JSON. Send UTF-8 JSON with Content-Type: application/json (Thai text: make sure your tool sends UTF-8; on Windows write the body to a UTF-8 file and send it with --data-binary @file)."}}}}}}},"/openapi/v1/generate_audio_v2":{"post":{"tags":["genvoice_v2"],"summary":"Speech with a V2 voice (paid: 0.2 points per letter, 0.1 for subscribers)","operationId":"generate_voice_v2_openapi_v1_generate_audio_v2_post","parameters":[{"name":"Botnoi-Token","in":"header","required":false,"schema":{"type":"string","description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)","title":"Botnoi-Token"},"description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateVoiceQueueRequest"},"example":{"text":"สวัสดีครับ","speaker":"8","volume":1,"speed":1,"type_media":"mp3","save_file":"true","language":"th","page":"user"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{},"example":{"text":"สวัสดีครับ","audio_url":"https://.../example.mp3","point":6534,"user_monthly_point":0}}}},"401":{"description":"No API key (send Botnoi-Token: <key> or Authorization: Bearer <key>), or a key that is not valid","content":{"application/json":{"examples":{"missing_key":{"summary":"No key sent","value":{"message":"Missing API key. Send your key in the header Botnoi-Token: <key> (Authorization: Bearer <key> also works). Get a key at https://voice.botnoi.ai/developer/api (new accounts get 2,000 free points)."}},"invalid_key":{"summary":"Key not valid","value":{"message":"Please get new token on https://voice.botnoi.ai/developer/api"}}}}}},"403":{"description":"Empty text, or a private voice of another account","content":{"application/json":{"example":{"message":"This voice is private"}}}},"404":{"description":"Not enough points (V1 / V2 answer 404 for this), or no account for the key","content":{"application/json":{"example":{"message":"Not enough credits!"}}}},"422":{"description":"Text longer than 500 characters","content":{"application/json":{"example":{"message":"Text is longer than 500 characters"}}}},"502":{"description":"The voice engine failed; no points taken","content":{"application/json":{"example":{"message":"Voice service error, please try again"}}}},"504":{"description":"No answer within 60 s","content":{"application/json":{"example":{"message":"Request timeout (60s exceeded)"}}}},"400":{"description":"The body is not UTF-8 JSON (e.g. Thai text sent in another encoding)","content":{"application/json":{"example":{"message":"The request body is not valid JSON. Send UTF-8 JSON with Content-Type: application/json (Thai text: make sure your tool sends UTF-8; on Windows write the body to a UTF-8 file and send it with --data-binary @file).","detail":"The request body is not valid JSON. Send UTF-8 JSON with Content-Type: application/json (Thai text: make sure your tool sends UTF-8; on Windows write the body to a UTF-8 file and send it with --data-binary @file)."}}}}}}},"/openapi/v1/get_speaker_data":{"get":{"tags":["genvoice_v1"],"summary":"Get Speaker V1","description":"The public V1 voices: a ready-made list (rebuilt weekly and on admin refresh), never a database read per call.","operationId":"get_speaker_v1_openapi_v1_get_speaker_data_get","parameters":[{"name":"If-None-Match","in":"header","required":false,"schema":{"type":"string","title":"If-None-Match"}}],"responses":{"200":{"description":"Successful Response - List of speakers","content":{"application/json":{"schema":{},"example":[{"speaker_id":"3","eng_name":"Ngam","thai_name":"คุณงาม","image":"https://bn-voice-pics.s3.ap-southeast-1.amazonaws.com/picture/ngam/ngam.webp","audio":"https://botnoi-voice.s3.ap-southeast-1.amazonaws.com/picture/ngam/sound_ngam.wav","voice_style":["เสียงมั่นใจ"],"eng_voice_style":["Confident"],"age_style":"วัยผู้ใหญ่","eng_age_style":"Adult","speech_style":["สไตล์เล่าเรื่อง","สไตล์บรรยาย"],"eng_speech_style":["Storytelling","Narrating"],"speed":"พูดกลาง","eng_speed":"Normal","language":"TH","gender":"ผู้หญิง","eng_gender":"Female","available_language":["en","id","ja","lo","my","th","vi","zh"],"price":1.0},{"speaker_id":"4","eng_name":"Max","thai_name":"แม็กซ์","image":"https://bn-voice-pics.s3.ap-southeast-1.amazonaws.com/picture/max/max.webp","audio":"https://botnoi-voice.s3.ap-southeast-1.amazonaws.com/picture/max/sound_max.wav","voice_style":["เสียงน่าเชื่อถือ"],"eng_voice_style":["Trustworthy"],"age_style":"วัยผู้ใหญ่","eng_age_style":"Adult","speech_style":["สไตล์เล่าเรื่อง","สไตล์อ่านข่าว"],"eng_speech_style":["Storytelling","News Reading"],"speed":"พูดกลาง","eng_speed":"Normal","language":"TH","gender":"ผู้ชาย","eng_gender":"Male","available_language":["en","id","ja","lo","my","th","vi","zh"],"price":1.0}]}}},"401":{"description":"Something went wrong!","content":{"application/json":{"example":{"detail":"Something went wrong!"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/openapi/v1/get_speaker_data_v2":{"get":{"tags":["genvoice_v2"],"summary":"Get Speaker V2","description":"The public V2 voices, same as get_speaker_data.","operationId":"get_speaker_v2_openapi_v1_get_speaker_data_v2_get","parameters":[{"name":"If-None-Match","in":"header","required":false,"schema":{"type":"string","title":"If-None-Match"}}],"responses":{"200":{"description":"Successful Response - List of speakers","content":{"application/json":{"schema":{},"example":[{"speaker_id":"3","eng_name":"Ngam","thai_name":"คุณงาม","image":"https://bn-voice-pics.s3.ap-southeast-1.amazonaws.com/picture/ngam/ngam.webp","audio":"https://botnoi-voice.s3.ap-southeast-1.amazonaws.com/picture/ngam/sound_ngam.wav","voice_style":["เสียงมั่นใจ"],"eng_voice_style":["Confident"],"age_style":"วัยผู้ใหญ่","eng_age_style":"Adult","speech_style":["สไตล์เล่าเรื่อง","สไตล์บรรยาย"],"eng_speech_style":["Storytelling","Narrating"],"speed":"พูดกลาง","eng_speed":"Normal","language":"TH","gender":"ผู้หญิง","eng_gender":"Female","available_language":["en","id","ja","lo","my","th","vi","zh"],"price":1.0},{"speaker_id":"4","eng_name":"Max","thai_name":"แม็กซ์","image":"https://bn-voice-pics.s3.ap-southeast-1.amazonaws.com/picture/max/max.webp","audio":"https://botnoi-voice.s3.ap-southeast-1.amazonaws.com/picture/max/sound_max.wav","voice_style":["เสียงน่าเชื่อถือ"],"eng_voice_style":["Trustworthy"],"age_style":"วัยผู้ใหญ่","eng_age_style":"Adult","speech_style":["สไตล์เล่าเรื่อง","สไตล์อ่านข่าว"],"eng_speech_style":["Storytelling","News Reading"],"speed":"พูดกลาง","eng_speed":"Normal","language":"TH","gender":"ผู้ชาย","eng_gender":"Male","available_language":["en","id","ja","lo","my","th","vi","zh"],"price":1.0}]}}},"401":{"description":"Something went wrong!","content":{"application/json":{"example":{"detail":"Something went wrong!"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/openapi/v1/deepseek/chat":{"post":{"tags":["deepseek"],"summary":"Deepseek Chat Endpoint","operationId":"deepseek_chat_endpoint_openapi_v1_deepseek_chat_post","parameters":[{"name":"Botnoi-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Botnoi-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepseekChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeepseekChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/openapi/v1/tts-realtime/ws":{"get":{"tags":["realtime-tts-websocket"],"summary":"Realtime TTS WebSocket documentation","description":"Shows the websocket endpoint, required headers, and the message flow for tts_session.update -> input_text.append -> input_text.done.","operationId":"realtime_tts_websocket_docs_openapi_v1_tts_realtime_ws_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"},"example":"Realtime TTS WebSocket docs\n\nWebSocket endpoint:\nwss://api-voice.botnoi.ai/openapi/v1/tts-realtime/ws\n\nAuthentication:\n- Authorization: Bearer <api_key>\n\nMessage flow:\n1. Connect to the websocket endpoint.\n2. Send `tts_session.update` first.\n3. Send one or more `input_text.append` events.\n4. Send `input_text.done` to start generation.\n5. Receive `response.audio.delta` as base64 audio chunks.\n6. Receive `response.audio.done` when generation finishes.\n\nNotes:\n- Swagger shows this documentation endpoint, not the websocket operation itself.\n- The websocket endpoint is still available at the path above.\n- After `input_text.done`, the server emits `response.audio.delta` first, then `response.audio.done`.\n- Decode `response.audio.delta` from base64 before playback.\n\nFlow diagram:\nClient                          Server\n  |                                |\n  |--- WebSocket upgrade --------->|  (Authorization: Bearer)\n  |                                |\n  |--- get_health (optional) ----->|  +- available any time\n  |<-- health_ready ---------------|  | after connection\n  |                                |  |\n  |--- get_speakers (optional) --->|  |\n  |<-- speaker_ready --------------|  +-\n  |                                |\n  |--- tts_session.update -------->|\n  |<-- tts_session.updated --------|\n  |                                |\n  |--- input_text.append --------->|  +- one generation\n  |--- input_text.done ----------->|  | (may call multiple times concurrently)\n  |<-- response.audio.delta -------|  |\n  |<-- response.audio.done --------|  +-\n  |                                |\n  |=== client closes connection ===|\n\n\nPayload examples:\n\n`tts_session.update`\n```json\n{\n  \"type\": \"tts_session.update\",\n  \"session\": {\n    \"voice\": \"1\",\n    \"language\": \"th\",\n    \"output_audio_format\": \"wav\",\n    \"output_audio_sample_rate\": 22050,\n    \"output_audio_speed_rate\": 1.0,\n    \"output_audio_volume\": 1.0,\n    \"output_audio_channel\": 1\n  }\n}\n```\n\n`input_text.append`\n```json\n{\n  \"type\": \"input_text.append\",\n  \"delta\": \"Hello, world.\"\n}\n```\n\n`input_text.done`\n```json\n{\n  \"type\": \"input_text.done\"\n}\n```\n\nResponse examples:\n\n`tts_session.updated`\n```json\n{\n  \"event_id\": \"srv_o-GqB3vDss-mFTXwPsaLAQ\",\n  \"type\": \"tts_session.updated\",\n  \"session\": {\n    \"voice\": \"1\",\n    \"language\": \"th\",\n    \"output_audio_format\": \"wav\",\n    \"output_audio_sample_rate\": 22050,\n    \"output_audio_speed_rate\": 1.0,\n    \"output_audio_volume\": 1.0,\n    \"output_audio_channel\": 1\n  }\n}\n```\n\n`response.audio.delta`\n```json\n{\n  \"event_id\": \"srv_31ipPrp4zoNdro2Q1e-tIg\",\n  \"type\": \"response.audio.delta\",\n  \"item_id\": \"item_n_nc4HOMWI4F7lbeI4HdyA\",\n  \"delta\": \"UklGRiQAAABXQVZFZm10IBAAAAABAAEAIlYAAESsAAACABAAZGF0YQ==\"\n}\n```\n\n`response.audio.done`\n```json\n{\n  \"event_id\": \"srv_JVn3pQ1xg2m8QeYh9kL0cA\",\n  \"type\": \"response.audio.done\",\n  \"item_id\": \"item_n_nc4HOMWI4F7lbeI4HdyA\"\n}\n```"}}}}}},"/openapi/v1/generate_audio_v4":{"post":{"tags":["genvoice_v4"],"summary":"Speech with a V4 voice (paid: 0.2 points per spoken letter, 0.1 for subscribers)","operationId":"generate_audio_v4_openapi_v1_generate_audio_v4_post","parameters":[{"name":"Botnoi-Token","in":"header","required":false,"schema":{"type":"string","description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)","title":"Botnoi-Token"},"description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateV4Request"},"example":{"text":"สวัสดีค่ะ [laughter] ยินดีต้อนรับนะคะ","speaker":"2","volume":100,"speed":1,"type_media":"mp3","save_file":"true","language":"th"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{},"example":{"text":"สวัสดีครับ","audio_url":"https://.../example.mp3","point":6534,"user_monthly_point":0,"speaker":"2","version":"v4","audio_edits":""}}}},"401":{"description":"No API key (send Botnoi-Token: <key> or Authorization: Bearer <key>), or a key that is not valid","content":{"application/json":{"examples":{"missing_key":{"summary":"No key sent","value":{"message":"Missing API key. Send your key in the header Botnoi-Token: <key> (Authorization: Bearer <key> also works). Get a key at https://voice.botnoi.ai/developer/api (new accounts get 2,000 free points)."}},"invalid_key":{"summary":"Key not valid","value":{"message":"Please get new token on https://voice.botnoi.ai/developer/api"}}}}}},"403":{"description":"Not enough points, or a voice of someone else","content":{"application/json":{"example":{"message":"Insufficient play quota or credits"}}}},"404":{"description":"An engine voice id that is not yours","content":{"application/json":{"example":{"message":"voice not found: use a Botnoi V4 voice, Voice Design, or your own clone by its speaker_id"}}}},"422":{"description":"Empty text, or text over the limit (1000 characters; 200 for Voice Design)","content":{"application/json":{"example":{"message":"Text is longer than 1000 characters"}}}},"429":{"description":"Over 30 calls a minute, or a call already running for this key (header Retry-After)","content":{"application/json":{"example":{"message":"One call at a time per API key: wait for your previous call to finish"}}}},"502":{"description":"The voice engine failed; no answer to show","content":{"application/json":{"example":{"message":"Voice service error, please try again"}}}},"503":{"description":"The voice engine is busy: waited 45 s for a free slot, no points taken (header Retry-After)","content":{"application/json":{"example":{"message":"ระบบเสียงมีคนใช้งานมาก กรุณาลองใหม่อีกครั้ง / The voice engine is busy. Please try again"}}}},"504":{"description":"No answer within 60 s","content":{"application/json":{"example":{"message":"Request timeout (60s exceeded)"}}}},"400":{"description":"The body is not UTF-8 JSON (e.g. Thai text sent in another encoding)","content":{"application/json":{"example":{"message":"The request body is not valid JSON. Send UTF-8 JSON with Content-Type: application/json (Thai text: make sure your tool sends UTF-8; on Windows write the body to a UTF-8 file and send it with --data-binary @file).","detail":"The request body is not valid JSON. Send UTF-8 JSON with Content-Type: application/json (Thai text: make sure your tool sends UTF-8; on Windows write the body to a UTF-8 file and send it with --data-binary @file)."}}}}}}},"/openapi/v1/generate_audio_v4d":{"post":{"tags":["genvoice_v4"],"summary":"Speech with V4 Voice Design (paid: the V4 price)","operationId":"generate_audio_v4d_openapi_v1_generate_audio_v4d_post","parameters":[{"name":"Botnoi-Token","in":"header","required":false,"schema":{"type":"string","description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)","title":"Botnoi-Token"},"description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateVoiceDesignRequest"},"example":{"text":"สวัสดีค่ะ วันนี้อากาศดีมาก เราไปเดินเล่นที่สวนสาธารณะกันไหมคะ","gender":"female","age":"young_adult","pitch":"moderate","style":"whisper","type_media":"mp3","save_file":"true"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{},"example":{"text":"สวัสดีครับ","audio_url":"https://.../example.mp3","point":6534,"user_monthly_point":0,"voice_design":{"gender":"female","style":"whisper"},"version":"v4d"}}}},"401":{"description":"No API key (send Botnoi-Token: <key> or Authorization: Bearer <key>), or a key that is not valid","content":{"application/json":{"examples":{"missing_key":{"summary":"No key sent","value":{"message":"Missing API key. Send your key in the header Botnoi-Token: <key> (Authorization: Bearer <key> also works). Get a key at https://voice.botnoi.ai/developer/api (new accounts get 2,000 free points)."}},"invalid_key":{"summary":"Key not valid","value":{"message":"Please get new token on https://voice.botnoi.ai/developer/api"}}}}}},"403":{"description":"Not enough points, or a voice of someone else","content":{"application/json":{"example":{"message":"Insufficient play quota or credits"}}}},"422":{"description":"Empty text, or text over 200 characters","content":{"application/json":{"example":{"message":"Text is longer than 200 characters"}}}},"429":{"description":"Over 30 calls a minute, or a call already running for this key (header Retry-After)","content":{"application/json":{"example":{"message":"One call at a time per API key: wait for your previous call to finish"}}}},"502":{"description":"The voice engine failed; no answer to show","content":{"application/json":{"example":{"message":"Voice service error, please try again"}}}},"503":{"description":"The voice engine is busy: waited 45 s for a free slot, no points taken (header Retry-After)","content":{"application/json":{"example":{"message":"ระบบเสียงมีคนใช้งานมาก กรุณาลองใหม่อีกครั้ง / The voice engine is busy. Please try again"}}}},"504":{"description":"No answer within 60 s","content":{"application/json":{"example":{"message":"Request timeout (60s exceeded)"}}}},"400":{"description":"The body is not UTF-8 JSON (e.g. Thai text sent in another encoding)","content":{"application/json":{"example":{"message":"The request body is not valid JSON. Send UTF-8 JSON with Content-Type: application/json (Thai text: make sure your tool sends UTF-8; on Windows write the body to a UTF-8 file and send it with --data-binary @file).","detail":"The request body is not valid JSON. Send UTF-8 JSON with Content-Type: application/json (Thai text: make sure your tool sends UTF-8; on Windows write the body to a UTF-8 file and send it with --data-binary @file)."}}}}}}},"/openapi/v1/get_speaker_data_v4":{"get":{"tags":["genvoice_v4"],"summary":"The V4 voices (free, no key)","description":"The V4 voices (all public presets) with their ids for generate_audio_v4: a ready-made list, like get_speaker_data.","operationId":"get_speaker_data_v4_openapi_v1_get_speaker_data_v4_get","parameters":[{"name":"If-None-Match","in":"header","required":false,"schema":{"type":"string","title":"If-None-Match"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/openapi/v1/get_voice_design_parameters":{"get":{"tags":["genvoice_v4"],"summary":"Voice Design values (free, needs the key)","description":"The values gender, age, pitch, style and accent may take in generate_audio_v4d.","operationId":"get_voice_design_parameters_openapi_v1_get_voice_design_parameters_get","parameters":[{"name":"Botnoi-Token","in":"header","required":false,"schema":{"type":"string","description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)","title":"Botnoi-Token"},"description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/openapi/v1/estimate_v4":{"post":{"tags":["genvoice_v4"],"summary":"Price a V4, Voice Design or clone text (free, no key)","description":"Points a V4 / Voice Design / clone text will cost, priced by the voice service by the rule it charges, not\nsubscribed (`points` API, `studio_points`) and as a subscriber (`points_subscriber`, `studio_points_subscriber`).\nFree, no key needed; with a key the answer also says `subscriber` and `your_points`.","operationId":"estimate_v4_openapi_v1_estimate_v4_post","parameters":[{"name":"Botnoi-Token","in":"header","required":false,"schema":{"type":"string","description":"Optional: your API key, to see your own price","title":"Botnoi-Token"},"description":"Optional: your API key, to see your own price"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateRequest"},"example":{"text":"สวัสดีค่ะ [laughter] delay{1} ยินดีต้อนรับ"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{},"example":{"points":5,"points_subscriber":3,"studio_points":42,"studio_points_subscriber":21,"spoken_letters":21,"tags":1,"characters":42,"version":"v4"}}}},"422":{"description":"Empty text, or over 20,000 characters","content":{"application/json":{"example":{"message":"Text is empty!"}}}},"502":{"description":"The voice service could not price it","content":{"application/json":{"example":{"message":"Voice service unavailable, please try again"}}}}}}},"/openapi/v1/get_clone_voices":{"get":{"tags":["genvoice_clone"],"summary":"Your own and everyone's public voice clones (free, needs the key)","description":"Your own voice clones and everyone's public clones, for generate_audio_clone. A clone is priced as a V4 voice.","operationId":"get_clone_voices_openapi_v1_get_clone_voices_get","parameters":[{"name":"Botnoi-Token","in":"header","required":false,"schema":{"type":"string","description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)","title":"Botnoi-Token"},"description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/openapi/v1/generate_audio_clone":{"post":{"tags":["genvoice_clone"],"summary":"Speech with a voice clone (paid: the V4 price)","description":"Speech in a voice clone (your own, or a public one). Spends points: the V4 API price.","operationId":"generate_audio_clone_openapi_v1_generate_audio_clone_post","parameters":[{"name":"Botnoi-Token","in":"header","required":false,"schema":{"type":"string","description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)","title":"Botnoi-Token"},"description":"Your API key from voice.botnoi.ai/developer/api (Authorization: Bearer <key> also works)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateCloneRequest"},"example":{"text":"สวัสดีค่ะ ยินดีต้อนรับนะคะ","speaker":"<speaker_id from get_clone_voices>","type_media":"mp3","save_file":"true"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{},"example":{"text":"สวัสดีครับ","audio_url":"https://.../example.mp3","point":6534,"user_monthly_point":0,"speaker":"<clone speaker_id>","version":"clone","audio_edits":""}}}},"401":{"description":"No API key (send Botnoi-Token: <key> or Authorization: Bearer <key>), or a key that is not valid","content":{"application/json":{"examples":{"missing_key":{"summary":"No key sent","value":{"message":"Missing API key. Send your key in the header Botnoi-Token: <key> (Authorization: Bearer <key> also works). Get a key at https://voice.botnoi.ai/developer/api (new accounts get 2,000 free points)."}},"invalid_key":{"summary":"Key not valid","value":{"message":"Please get new token on https://voice.botnoi.ai/developer/api"}}}}}},"402":{"description":"Not enough points","content":{"application/json":{"example":{"message":"insufficient monthly_point and credits"}}}},"403":{"description":"Someone else's private clone","content":{"application/json":{"example":{"message":"this voice is private"}}}},"404":{"description":"No clone with this speaker_id","content":{"application/json":{"example":{"message":"voice clone not found"}}}},"422":{"description":"Empty text, no speaker, or text over 1000 characters","content":{"application/json":{"example":{"message":"Text is longer than 1000 characters"}}}},"429":{"description":"Over 30 calls a minute, or a call already running for this key (header Retry-After)","content":{"application/json":{"example":{"message":"One call at a time per API key: wait for your previous call to finish"}}}},"502":{"description":"The voice engine failed; no answer to show","content":{"application/json":{"example":{"message":"Voice service error, please try again"}}}},"503":{"description":"The voice engine is busy: waited 45 s for a free slot, no points taken (header Retry-After)","content":{"application/json":{"example":{"message":"ระบบเสียงมีคนใช้งานมาก กรุณาลองใหม่อีกครั้ง / The voice engine is busy. Please try again"}}}},"504":{"description":"No answer within 60 s","content":{"application/json":{"example":{"message":"Request timeout (60s exceeded)"}}}},"400":{"description":"The body is not UTF-8 JSON (e.g. Thai text sent in another encoding)","content":{"application/json":{"example":{"message":"The request body is not valid JSON. Send UTF-8 JSON with Content-Type: application/json (Thai text: make sure your tool sends UTF-8; on Windows write the body to a UTF-8 file and send it with --data-binary @file).","detail":"The request body is not valid JSON. Send UTF-8 JSON with Content-Type: application/json (Thai text: make sure your tool sends UTF-8; on Windows write the body to a UTF-8 file and send it with --data-binary @file)."}}}}}}}},"components":{"schemas":{"ChatMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"anyOf":[{"items":{},"type":"array"},{}],"title":"Content"}},"type":"object","required":["role","content"],"title":"ChatMessage"},"DeepseekChatRequest":{"properties":{"model":{"type":"string","title":"Model","default":"deepseek-v4-flash"},"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"Messages"},"reasoning_effort":{"type":"string","title":"Reasoning Effort","default":"high"},"thinking_enabled":{"type":"boolean","title":"Thinking Enabled","default":true},"stream":{"type":"boolean","title":"Stream","default":false},"max_tokens":{"type":"integer","title":"Max Tokens","default":512}},"type":"object","required":["messages"],"title":"DeepseekChatRequest"},"DeepseekChatResponse":{"properties":{"response":{"type":"string","title":"Response"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"total_tokens":{"type":"integer","title":"Total Tokens"},"usage_cost_baht":{"type":"number","title":"Usage Cost Baht"},"charged_cost_baht":{"type":"number","title":"Charged Cost Baht"},"points_used":{"type":"integer","title":"Points Used"},"credits_left":{"type":"integer","title":"Credits Left"}},"type":"object","required":["response","input_tokens","output_tokens","total_tokens","usage_cost_baht","charged_cost_baht","points_used","credits_left"],"title":"DeepseekChatResponse"},"EstimateRequest":{"properties":{"text":{"type":"string","title":"Text","description":"The text to price, up to 20,000 characters"}},"type":"object","required":["text"],"title":"EstimateRequest"},"EstimateV12Request":{"properties":{"text":{"type":"string","title":"Text","description":"The text to price, up to 20,000 characters"},"speaker":{"type":"string","title":"Speaker","description":"Speaker id from get_speaker_data (v1) or get_speaker_data_v2 (v2)"},"version":{"type":"string","title":"Version","description":"v1 or v2 (for V4 use /estimate_v4)","default":"v2"}},"type":"object","required":["text","speaker"],"title":"EstimateV12Request"},"GenerateCloneRequest":{"properties":{"text":{"type":"string","title":"Text","description":"Up to 1000 characters. Sound tags as for V4"},"speaker":{"type":"string","title":"Speaker","description":"A clone's speaker_id from get_clone_voices"},"type_media":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type Media","description":"mp3 or wav","default":"mp3"},"save_file":{"anyOf":[{},{"type":"null"}],"title":"Save File","description":"false: answer the audio itself instead of a link","default":"true"},"speed":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speed"},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"}},"type":"object","required":["text","speaker"],"title":"GenerateCloneRequest"},"GenerateV4Request":{"properties":{"text":{"type":"string","title":"Text","example":"สวัสดีครับ"},"speaker":{"type":"string","title":"Speaker","example":"1"},"volume":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Volume","default":100,"example":100},"speed":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Speed","default":1,"example":1},"type_media":{"type":"string","title":"Type Media","example":"mp3"},"save_file":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"null"}],"title":"Save File","default":"true","example":"true"},"streaming":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Streaming","default":false,"example":false},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","default":"th","example":"th"},"page":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page","default":"user","example":"user"},"split_english":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"null"}],"title":"Split English","description":"Voice long English names (2+ words or 10+ letters) on their own and join them back. Can help a Thai line with a multi-word English name; slower (no streaming). Default false","default":false},"trim_breath":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"null"}],"title":"Trim Breath","description":"Cut the breath before the first word and after the last. Default false","default":false},"auto_fix_words":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"null"}],"title":"Auto Fix Words","description":"In a Thai line, English words that Thai voices misread are read with a tested Thai spelling (e.g. Model as โมเดล). The text and price stay as sent. Default false: the reading improvements now live in the voice model itself (17 Nov 2026)","default":false}},"additionalProperties":true,"type":"object","required":["text","speaker","type_media"],"title":"GenerateV4Request","description":"generate_audio_v4's body: the V1/V2 fields plus V4's optional sound edits (both off when not sent)."},"GenerateVoiceDesignRequest":{"properties":{"text":{"type":"string","title":"Text","description":"Up to 200 characters, at least about 3 seconds of speech"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender","description":"See get_voice_design_parameters"},"age":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Age"},"pitch":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pitch"},"style":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Style"},"accent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accent","description":"English text only"},"type_media":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type Media","default":"mp3"},"save_file":{"anyOf":[{},{"type":"null"}],"title":"Save File","default":"true"}},"type":"object","required":["text"],"title":"GenerateVoiceDesignRequest"},"GenerateVoiceQueueRequest":{"properties":{"text":{"type":"string","title":"Text","example":"สวัสดีครับ"},"speaker":{"type":"string","title":"Speaker","example":"1"},"volume":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Volume","default":100,"example":100},"speed":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"}],"title":"Speed","default":1,"example":1},"type_media":{"type":"string","title":"Type Media","example":"mp3"},"save_file":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"null"}],"title":"Save File","default":"true","example":"true"},"streaming":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Streaming","default":false,"example":false},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","default":"th","example":"th"},"page":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page","default":"user","example":"user"}},"additionalProperties":true,"type":"object","required":["text","speaker","type_media"],"title":"GenerateVoiceQueueRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}