### Synthesize Speech with Emotion (Instructions) Source: https://neuraldeep.tech/docs This example shows how to synthesize speech with a specified emotion and enthusiasm using the 'vivian' voice and the 'instructions' parameter. Replace '$YOUR_KEY' with your API key. ```bash # с эмоцией (через instructions) curl -s https://api.neuraldeep.ru/v1/audio/speech \ -H "Authorization: Bearer $YOUR_KEY" -H "Content-Type: application/json" \ -d '{"input":"Поздравляю с релизом!","voice":"vivian","language":"Russian","instructions":"радостно, с энтузиазмом"}' \ -o happy.wav ``` -------------------------------- ### Synthesize Speech to WAV (Russian Voice) Source: https://neuraldeep.tech/docs This example demonstrates how to synthesize Russian speech using the 'serena' voice and save the output to a WAV file. Ensure you replace '$YOUR_KEY' with your actual API key. ```bash # синтез (голос serena, русский) → файл curl -s https://api.neuraldeep.ru/v1/audio/speech \ -H "Authorization: Bearer $YOUR_KEY" -H "Content-Type: application/json" \ -d '{"input":"Привет! Это синтез речи на наших серверах.","voice":"serena","language":"Russian"}' \ -o speech.wav ``` -------------------------------- ### Synthesize Speech with Manual Stress Placement Source: https://neuraldeep.tech/docs This example demonstrates how to manually set stress on a word using the '+' character before the stressed vowel. The RUAccent model will not interfere if '+' is already present. Replace '$YOUR_KEY' with your API key. ```bash # ударение вручную через «+» (зам+ок = запор) — RUAccent не вмешивается, если «+» уже есть curl -s https://api.neuraldeep.ru/v1/audio/speech \ -H "Authorization: Bearer $YOUR_KEY" -H "Content-Type: application/json" \ -d '{"input":"Он повесил амбарный зам+ок.","voice":"serena","language":"Russian"}' \ -o stress.wav ``` -------------------------------- ### Structured Output Generation (JSON Schema / Guided Grammar) Source: https://neuraldeep.tech/docs For more advanced structured output, use `response_format` with `{"type": "json_schema"}` and provide a JSON schema. The `strict: true` option ensures the output adheres strictly to the provided schema. ```APIDOC ## POST /v1/chat/completions (JSON Schema / Guided Grammar) ### Description Allows for generating responses that conform to a specified JSON schema, enabling guided grammar and strict adherence to structure. Use `response_format` with `{"type": "json_schema"}` and provide the schema. ### Method POST ### Endpoint /v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The model to use for the completion. - **messages** (array) - Required - An array of message objects, typically containing a user prompt. - **response_format** (object) - Required - Specifies the desired output format. For JSON schema output, use `{"type": "json_schema", "json_schema": {...}}` where `...` is the JSON schema definition. - **strict** (boolean) - Optional - If true, the output will strictly adhere to the provided schema. Defaults to false. ### Request Example ```json { "model": "gpt-oss-120b", "messages": [{"role":"user","content":"Иван, 30 лет"}], "response_format": {"type":"json_schema","json_schema":{ "name":"Person","schema":{ "type":"object", "properties":{ "name":{"type":"string"}, "age":{"type":"integer"} }, "required":["name","age"] }, "strict":true }} } ``` ### Response #### Success Response (200) - **choices** (array) - Contains the model's response(s). - **message** (object) - **content** (string) - The generated response, conforming to the provided JSON schema. #### Response Example ```json { "choices": [ { "message": { "content": "{\"name\": \"Иван\", \"age\": 30}" } } ] } ``` ``` -------------------------------- ### Get Quota Remaining Source: https://neuraldeep.tech/docs Retrieves the remaining quota for speech synthesis, typically measured in characters. ```APIDOC ## GET /v1/audio/quota ### Description Retrieves the remaining quota for speech synthesis, which is calculated based on the number of input characters. ### Method GET ### Endpoint /v1/audio/quota ### Response #### Success Response (200) - **quota_remaining** (integer) - The number of characters remaining in the current quota. #### Response Example ```json { "quota_remaining": 15000 } ``` ``` -------------------------------- ### Upload File and Chat in One Session using Python Source: https://neuraldeep.tech/docs This Python script demonstrates uploading a file and then using it in a chat completion request within the same session. The uploaded file's preview is accessible in the initial prompt. ```python import httpx TOKEN = "dft_xxxxxxxx" BASE = "https://drift.neuraldeep.ru/v1" # 1) upload with open("report.pdf","rb") as f: up = httpx.post(f"{BASE}/files/upload", headers={"Authorization": f"Bearer {TOKEN}"}, files={"file": ("report.pdf", f, "application/pdf")}).json() print("preview:", up["uploaded"][0]["preview"][:200]) # 2) ask agent — он уже видит preview в init prompt r = httpx.post(f"{BASE}/chat/completions", headers={"Authorization": f"Bearer {TOKEN}"}, json={"model":"qwen3.6-35b-a3b","messages":[ {"role":"user","content":"Резюмируй report.pdf"} ]}).json() print(r["choices"][0]["message"]["content"]) ``` -------------------------------- ### Synthesize Speech using Python Source: https://neuraldeep.tech/docs This Python script demonstrates how to synthesize speech using the httpx library and save the output to a WAV file. Replace '$YOUR_KEY' with your API key. ```python import httpx r = httpx.post( "https://api.neuraldeep.ru/v1/audio/speech", headers={"Authorization": "Bearer $YOUR_KEY"}, json={"input": "Текст для озвучки.", "voice": "dylan", "language": "Russian"}, ) open("speech.wav", "wb").write(r.content) ``` -------------------------------- ### Chat Completions with File Preview Source: https://neuraldeep.tech/docs Submit a chat completion request, where the model can utilize the preview of an uploaded file provided in the init prompt. ```APIDOC ## POST /v1/chat/completions ### Description Submits a chat completion request to a specified model. If a file has been previously uploaded and its preview is available, the model can access this preview within the initial prompt to generate a response. ### Method POST ### Endpoint https://drift.neuraldeep.ru/v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The model to use for generating the completion. - **messages** (array) - Required - A list of message objects representing the conversation history. - **role** (string) - Required - The role of the message sender ('user' or 'assistant'). - **content** (string) - Required - The content of the message. This can include instructions referencing uploaded files. ### Request Example ```python import httpx TOKEN = "dft_xxxxxxxx" BASE = "https://drift.neuraldeep.ru/v1" # Assuming report.pdf has been uploaded via /v1/files/upload r = httpx.post(f"{BASE}/chat/completions", headers={"Authorization": f"Bearer {TOKEN}"}, json={"model":"qwen3.6-35b-a3b","messages":[ {"role":"user","content":"Summarize report.pdf"} ]}).json() print(r["choices"][0]["message"]["content"]) ``` ### Response #### Success Response (200) - **choices** (array) - A list of completion choices. - **message** (object) - The generated message. - **role** (string) - The role of the message sender ('assistant'). - **content** (string) - The content of the assistant's response. #### Response Example ```json { "choices": [ { "message": { "role": "assistant", "content": "The report summarizes key findings on..." } } ] } ``` ``` -------------------------------- ### Full OCR Workflow with Polling in Python Source: https://neuraldeep.tech/docs This Python script illustrates the complete OCR process: uploading a document, asynchronously polling for job completion, and then fetching the extracted content. It uses the httpx library for making HTTP requests. ```python import time, httpx H = {"Authorization": "Bearer $YOUR_KEY"} # 1. загрузка with open("invoice.pdf", "rb") as f: job = httpx.post( "https://api.neuraldeep.ru/v1/ocr/extract", headers=H, files={"file": f}, ).json() jid = job["id"] print("страниц:", job["page_count"], "списано:", job["scan_pages_charged"]) # 2. поллинг (раз в секунду) while True: st = httpx.get(f"https://api.neuraldeep.ru/v1/ocr/jobs/{jid}", headers=H).json() if st["status"] == "completed": break time.sleep(1) # 3. результат res = httpx.get( f"https://api.neuraldeep.ru/v1/ocr/jobs/{jid}/result", params={"format": "markdown"}, headers=H, ).json() print(res["content"]) ``` -------------------------------- ### List Available Voices Source: https://neuraldeep.tech/docs This command retrieves a list of all available voices for speech synthesis. Replace '$YOUR_KEY' with your API key. ```bash # список голосов curl https://api.neuraldeep.ru/v1/audio/voices -H "Authorization: Bearer $YOUR_KEY" ``` -------------------------------- ### Image Recognition with Multimodal API Source: https://neuraldeep.tech/docs Use the `/v1/chat/completions` endpoint to send images (as URLs or base64 encoded strings) along with text prompts. The model can describe the image, extract text, and answer questions about the visual content. Note that only one image is supported per request. ```APIDOC ## POST /v1/chat/completions ### Description Processes multimodal input including text and images to perform tasks like image description, text extraction, and answering questions about the image. ### Method POST ### Endpoint /v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The model to use for the completion. - **messages** (array) - Required - An array of message objects. Each object can contain: - **role** (string) - Required - The role of the message sender ('user' or 'assistant'). - **content** (array) - Required - An array of content parts, which can be: - `{"type": "text", "text": "Your text prompt"}` - `{"type": "image_url", "image_url": {"url": "URL or base64 encoded image data"}}` - **max_tokens** (integer) - Optional - The maximum number of tokens to generate. ### Request Example ```json { "model": "qwen3.6-35b-a3b", "messages": [ { "role": "user", "content": [ {"type":"text","text":"What is in the image? Extract text if any."}, {"type":"image_url","image_url":{"url":"data:image/jpeg;base64,/9j/..."}} ] } ], "max_tokens": 500 } ``` ### Response #### Success Response (200) - **choices** (array) - Contains the model's response(s). - **message** (object) - **content** (string) - The generated text response. #### Response Example ```json { "choices": [ { "message": { "content": "The image shows a landscape with mountains and a river." } } ] } ``` ``` -------------------------------- ### Python SDK Integration Source: https://neuraldeep.tech/docs Use the official OpenAI Python SDK by changing the base URL to connect to the NeuralDeep API. Ensure you replace '$YOUR_KEY' with your actual API key. ```python from openai import OpenAI client = OpenAI(api_key="$YOUR_KEY", base_url="https://api.neuraldeep.ru/v1") r = client.chat.completions.create(model="gpt-oss-120b", messages=[...], max_tokens=500) ``` -------------------------------- ### Image Recognition with Base64 Source: https://neuraldeep.tech/docs Use this snippet to send an image as a base64 encoded string in the content array for multimodal chat completions. The model can describe the image and extract text. ```bash curl https://api.neuraldeep.ru/v1/chat/completions \ -H "Authorization: Bearer $YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen3.6-35b-a3b", "messages": [{"role": "user", "content": [{"type":"text","text":"Что на картинке? Извлеки текст если есть."},{"type":"image_url","image_url":{"url":"data:image/jpeg;base64,/9j/..."}}] }], "max_tokens": 500 }' ``` -------------------------------- ### Image Recognition from File Source: https://neuraldeep.tech/docs This Python code reads an image file, encodes it to base64, and sends it to the API for analysis. Ensure the image file exists in the same directory or provide the correct path. ```python import base64 from openai import OpenAI with open("photo.jpg","rb") as f: b64 = base64.b64encode(f.read()).decode() client = OpenAI(api_key="$YOUR_KEY", base_url="https://api.neuraldeep.ru/v1") r = client.chat.completions.create( model="qwen3.6-35b-a3b", messages=[{ "role":"user", "content":[ {"type":"text","text":"Опиши кратко что на фото"}, {"type":"image_url","image_url":{"url":f"data:image/jpeg;base64,{b64}"}}, ], }], max_tokens=400, ) print(r.choices[0].message.content) ``` -------------------------------- ### Trigger Agent via Webhook Source: https://neuraldeep.tech/docs This cURL command demonstrates how to trigger an agent using a webhook. The request body should contain the agent's input, and the webhook token authenticates the request. ```bash curl -X POST https://drift.neuraldeep.ru/v1/agents/hook/<токен-вебхука> \ -H "Content-Type: application/json" \ -d '{"topic": "Сделай отчёт по рынку ИИ в РФ"}' ``` -------------------------------- ### Upload File using cURL Source: https://neuraldeep.tech/docs Use this cURL command to upload a file to the Drift API. The response includes information about the uploaded file and a preview. ```shell curl -X POST https://drift.neuraldeep.ru/v1/files/upload \ -H "Authorization: Bearer dft_xxxxxxxx" \ -F file=@./report.pdf # → {"uploaded":[{"name":"report.pdf","path":"report.pdf","size":48863, # "preview":"...первые 2 страницы PDF..."}]} ``` -------------------------------- ### Task Management API Source: https://neuraldeep.tech/docs API endpoints for creating, listing, running, and deleting tasks. ```APIDOC ## POST /v1/tasks ### Description Creates a new task. ### Method POST ### Endpoint /v1/tasks ### Parameters #### Request Body - **title** (string) - Required - The title of the task. - **schedule** (string) - Required - The cron-syntax schedule for the task (e.g., "0 9 * * *"). - **prompt** (string) - Required - The prompt or instruction for the task. - **active** (boolean) - Required - Whether the task is active. ### Request Example ```json { "title": "Проверь почту в 9 утра", "schedule": "0 9 * * *", "prompt": "Посмотри новые письма в Gmail и резюмируй важные", "active": true } ``` ## GET /v1/tasks ### Description Retrieves a list of all tasks. ### Method GET ### Endpoint /v1/tasks ## POST /v1/tasks/{task_id}/run ### Description Manually triggers the immediate execution of a specific task. ### Method POST ### Endpoint /v1/tasks/{task_id}/run ### Parameters #### Path Parameters - **task_id** (string) - Required - The ID of the task to run. ## DELETE /v1/tasks/{task_id} ### Description Deletes a specific task. ### Method DELETE ### Endpoint /v1/tasks/{task_id} ### Parameters #### Path Parameters - **task_id** (string) - Required - The ID of the task to delete. ``` -------------------------------- ### Drift Task Management API Source: https://neuraldeep.tech/docs Use these cURL commands to manage tasks within the Drift system. This includes creating, listing, running, and deleting scheduled tasks. ```bash curl -X POST https://drift.neuraldeep.ru/v1/tasks \ -H "Authorization: Bearer dft_xxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "title": "Проверь почту в 9 утра", "schedule": "0 9 * * *", "prompt": "Посмотри новые письма в Gmail и резюмируй важные", "active": true }' ``` ```bash curl https://drift.neuraldeep.ru/v1/tasks -H "Authorization: Bearer dft_xxxxxxxx" ``` ```bash curl -X POST https://drift.neuraldeep.ru/v1/tasks/{task_id}/run \ -H "Authorization: Bearer dft_xxxxxxxx" ``` ```bash curl -X DELETE https://drift.neuraldeep.ru/v1/tasks/{task_id} \ -H "Authorization: Bearer dft_xxxxxxxx" ``` -------------------------------- ### File Upload Source: https://neuraldeep.tech/docs Upload a file to the Drift service. The uploaded file can be previewed and accessed by models in subsequent chat requests. ```APIDOC ## POST /v1/files/upload ### Description Uploads a file to the Drift service. The file is stored in a per-user workspace and made available in a Docker sandbox for processing and preview. ### Method POST ### Endpoint https://drift.neuraldeep.ru/v1/files/upload ### Parameters #### Request Body - **file** (file) - Required - The file to upload. Can be of various formats like PDF, XLSX, CSV, TXT, MD, DOCX, PNG, JPG, WEBP. ### Request Example ```bash curl -X POST https://drift.neuraldeep.ru/v1/files/upload \ -H "Authorization: Bearer dft_xxxxxxxx" \ -F file=@./report.pdf ``` ### Response #### Success Response (200) - **uploaded** (array) - A list of uploaded file objects. - **name** (string) - The name of the uploaded file. - **path** (string) - The path to the uploaded file. - **size** (integer) - The size of the uploaded file in bytes. - **preview** (string) - A preview of the file content (e.g., first pages of PDF, first lines of text files). May be null for unsupported preview formats. #### Response Example ```json { "uploaded": [ { "name": "report.pdf", "path": "report.pdf", "size": 48863, "preview": "...first 2 pages of PDF..." } ] } ``` ``` -------------------------------- ### Overwrite User Memory via API Source: https://neuraldeep.tech/docs Use this cURL command with the PUT method to completely overwrite a user's memory file. Be cautious as this action replaces all existing content. Replace 'dft_xxxxxxxx' with your authorization token and provide the new content in JSON format. ```bash # перезаписать (осторожно — переписывает всё) curl -X PUT https://drift.neuraldeep.ru/v1/memory \ -H "Authorization: Bearer dft_xxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"content":"# Memory\n\n- Проект Y стартует 1 июня"}' ``` -------------------------------- ### OCR Document Upload, Status Check, and Result Retrieval using cURL Source: https://neuraldeep.tech/docs This snippet demonstrates how to use cURL to upload a document for OCR, check the status of the processing job, and retrieve the results in Markdown format. It also shows how to specify higher quality profiles and page ranges. ```bash # 1. загрузить (вернёт {"id":"job_...","page_count":N}) curl https://api.neuraldeep.ru/v1/ocr/extract \ -H "Authorization: Bearer $YOUR_KEY" \ -F "file=@invoice.pdf" # (повыше качество: добавь -F "model_profile=pro"; # диапазон страниц: -F 'page_ranges=[{"start":1,"end":5}]') ``` ```bash # 2. статус задачи curl https://api.neuraldeep.ru/v1/ocr/jobs/job_123 \ -H "Authorization: Bearer $YOUR_KEY" ``` ```bash # 3. результат в markdown curl "https://api.neuraldeep.ru/v1/ocr/jobs/job_123/result?format=markdown" \ -H "Authorization: Bearer $YOUR_KEY" ``` -------------------------------- ### Read User Memory via API Source: https://neuraldeep.tech/docs Use this cURL command to retrieve the content of a user's memory file (MEMORY.md). Ensure you replace 'dft_xxxxxxxx' with your actual authorization token. ```bash # прочитать curl https://drift.neuraldeep.ru/v1/memory \ -H "Authorization: Bearer dft_xxxxxxxx" ``` -------------------------------- ### List Available Voices Source: https://neuraldeep.tech/docs Retrieves a list of available voices for speech synthesis. ```APIDOC ## GET /v1/audio/voices ### Description Retrieves a list of available voices that can be used for speech synthesis. ### Method GET ### Endpoint /v1/audio/voices ### Response #### Success Response (200) - **voices** (array) - A list of available voice objects, each with details like name and gender. #### Response Example ```json { "voices": [ {"name": "vivian", "gender": "female"}, {"name": "serena", "gender": "female"}, {"name": "dylan", "gender": "male"} // ... other voices ] } ``` ``` -------------------------------- ### JavaScript/TypeScript SDK Integration Source: https://neuraldeep.tech/docs Integrate with the NeuralDeep API using the official OpenAI JavaScript SDK. Update the baseURL to 'https://api.neuraldeep.ru/v1' and provide your API key. ```typescript import OpenAI from "openai"; const client = new OpenAI({ apiKey: "$YOUR_KEY", baseURL: "https://api.neuraldeep.ru/v1" }); ``` -------------------------------- ### Structured Output Generation (JSON Mode) Source: https://neuraldeep.tech/docs Utilize the `response_format` parameter with `{"type": "json_object"}` to ensure the model outputs valid JSON. This is useful for extracting structured data from text. ```APIDOC ## POST /v1/chat/completions (JSON Mode) ### Description Enables the model to output responses strictly in JSON format by setting `response_format` to `{"type": "json_object"}`. This is ideal for extracting structured data. ### Method POST ### Endpoint /v1/chat/completions ### Parameters #### Request Body - **model** (string) - Required - The model to use for the completion. - **messages** (array) - Required - An array of message objects, typically containing a user prompt. - **response_format** (object) - Required - Specifies the desired output format. For JSON output, use `{"type": "json_object"}`. ### Request Example ```json { "model": "gpt-oss-120b", "messages": [{"role":"user","content":"Extract name and age from: Иван, 30 лет"}], "response_format": {"type":"json_object"} } ``` ### Response #### Success Response (200) - **choices** (array) - Contains the model's response(s). - **message** (object) - **content** (string) - The generated response, guaranteed to be valid JSON. #### Response Example ```json { "choices": [ { "message": { "content": "{\"name\": \"Иван\", \"age\": 30}" } } ] } ``` ``` -------------------------------- ### Agent Triggering API Source: https://neuraldeep.tech/docs API endpoint for triggering an agent via a webhook. ```APIDOC ## POST /v1/agents/hook/{webhook_token} ### Description Triggers an agent to run using a webhook. The request body serves as the input for the agent. ### Method POST ### Endpoint /v1/agents/hook/{webhook_token} ### Parameters #### Path Parameters - **webhook_token** (string) - Required - The unique webhook token for authentication and identification of the agent. #### Request Body - **topic** (string) - Required - The input or prompt for the agent's task. ### Request Example ```json { "topic": "Сделай отчёт по рынку ИИ в РФ" } ``` ### Response #### Success Response (200) - **ok** (boolean) - Indicates if the request was processed. - **accepted** (boolean) - Indicates if the agent execution was accepted and will run in the background. #### Response Example ```json { "ok": true, "accepted": true } ``` ``` -------------------------------- ### Write User Memory Source: https://neuraldeep.tech/docs Completely overwrites the user's persistent memory with new content. Use with caution. ```APIDOC ## PUT /v1/memory ### Description Overwrites the user's persistent memory with the provided content. This action is destructive and will replace all existing memory. ### Method PUT ### Endpoint /v1/memory ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token for authentication (e.g., `Bearer dft_xxxxxxxx`) - **Content-Type** (string) - Required - Must be `application/json` #### Request Body - **content** (string) - Required - The new content to be written to the memory. This will replace the entire existing memory. ### Request Example ```json { "content": "# Memory\n\n- Проект Y стартует 1 июня" } ``` ### Response #### Success Response (200) (No specific response body is detailed for success, but the memory is updated.) ``` -------------------------------- ### OCR Document Extraction Source: https://neuraldeep.tech/docs Upload a document (PDF, PNG, JPG, WEBP, BMP, TIFF) for OCR processing. This endpoint initiates an asynchronous job and returns a job ID and page count. ```APIDOC ## POST /v1/ocr/extract ### Description Upload a document for OCR processing. Returns a job ID and the total number of pages. ### Method POST ### Endpoint /v1/ocr/extract ### Parameters #### Form Data - **file** (file) - Required - The document file to process. - **model_profile** (string) - Optional - The OCR model profile to use. Options: `fast` (default), `pro` (higher quality, counts as 2 pages). - **page_ranges** (array) - Optional - Specifies a range of pages to process. Example: `[{"start":1,"end":5}]`. ``` -------------------------------- ### Structured Output with JSON Mode Source: https://neuraldeep.tech/docs This cURL command demonstrates how to request structured JSON output from the API by setting the `response_format` to `json_object`. It's useful for extracting specific fields like name and age. ```bash curl https://api.neuraldeep.ru/v1/chat/completions \ -H "Authorization: Bearer $YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-oss-120b", "messages": [{"role":"user","content":"Extract name and age from: Иван, 30 лет"}], "response_format": {"type":"json_object"} }' ``` -------------------------------- ### OCR Balance Source: https://neuraldeep.tech/docs Check the remaining OCR balance for the account. ```APIDOC ## GET /v1/ocr/balance ### Description Retrieves the current OCR page balance for the authenticated account. ### Method GET ### Endpoint /v1/ocr/balance ``` -------------------------------- ### Text-to-Speech Synthesis Source: https://neuraldeep.tech/docs Synthesizes speech from input text using a specified voice and language. Supports custom emotions and manual stress placement. ```APIDOC ## POST /v1/audio/speech ### Description Synthesizes speech from input text using a specified voice and language. Supports custom emotions and manual stress placement. ### Method POST ### Endpoint /v1/audio/speech ### Parameters #### Request Body - **input** (string) - Required - The text to be synthesized. - **voice** (string) - Required - The voice to use for synthesis (e.g., `vivian`, `serena`, `dylan`). - **language** (string) - Required - The language of the input text (e.g., `Russian`, `English`). - **instructions** (string) - Optional - Free text to define emotion and style (e.g., "радостно", "спокойный диктор"). ### Request Example ```json { "input": "Привет! Это синтез речи на наших серверах.", "voice": "serena", "language": "Russian" } ``` ### Response #### Success Response (200) - **audio/wav** - The synthesized speech as a WAV audio file. #### Response Example (Binary audio data) **Note:** The response includes an `X-TTS-Engine` header indicating the engine used (`espeech` or `qwen`). ``` -------------------------------- ### Read User Memory Source: https://neuraldeep.tech/docs Retrieves the entire content of the user's persistent memory (MEMORY.md). ```APIDOC ## GET /v1/memory ### Description Retrieves the content of the user's persistent memory. ### Method GET ### Endpoint /v1/memory ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token for authentication (e.g., `Bearer dft_xxxxxxxx`) ### Response #### Success Response (200) - **content** (string) - The content of the user's memory, typically in markdown format. ``` -------------------------------- ### Structured Output with Pydantic Schema Source: https://neuraldeep.tech/docs This Python snippet uses Pydantic to define a schema for structured output. The API will attempt to return data conforming to this schema, ensuring type safety and validation. Set `strict: true` for strict JSON adherence. ```python from pydantic import BaseModel from openai import OpenAI class Person(BaseModel): name: str age: int client = OpenAI(api_key="$YOUR_KEY", base_url="https://api.neuraldeep.ru/v1") r = client.chat.completions.create( model="gpt-oss-120b", messages=[{"role":"user","content":"Иван, 30 лет"}], response_format={"type":"json_schema","json_schema":{ "name":"Person","schema":Person.model_json_schema(),"strict":True }}, ) person = Person.model_validate_json(r.choices[0].message.content) ``` -------------------------------- ### OCR Job Result Source: https://neuraldeep.tech/docs Retrieve the OCR result for a completed job in the specified format (markdown, json, text). ```APIDOC ## GET /v1/ocr/jobs/{job_id}/result ### Description Fetch the OCR processing result for a completed job. ### Method GET ### Endpoint /v1/ocr/jobs/{job_id}/result ### Parameters #### Path Parameters - **job_id** (string) - Required - The ID of the OCR job. #### Query Parameters - **format** (string) - Required - The desired output format for the result. Options: `markdown`, `json`, `text`. ``` -------------------------------- ### OCR Job Status Source: https://neuraldeep.tech/docs Check the status of an ongoing OCR job using its job ID. This endpoint is for polling the job's progress. ```APIDOC ## GET /v1/ocr/jobs/{job_id} ### Description Retrieve the current status of an OCR job. ### Method GET ### Endpoint /v1/ocr/jobs/{job_id} ### Parameters #### Path Parameters - **job_id** (string) - Required - The ID of the OCR job. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.