--- sidebar_position: 2 description: Create transcription and other functions to work with OpenAI in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, OpenAI] --- import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; # Create transcription Creates a text transcription for the selected audio file `Function CreateTranscription(Val URL, Val Token, Val Model, Val Audio, Val MIME = "audio/mpeg", Val AdditionalParameters = "", Val AdditionalHeaders = "") Export` | Parameter | CLI option | Type | Required | Description | |-|-|-|-|-| | URL | --url | String | ✔ | OpenAI server URL | | Token | --token | String | ✔ | OpenAI authorization token | | Model | --model | String | ✔ | Models name | | Audio | --audio | String, BinaryData | ✔ | Audio file | | MIME | --type | String | ✖ | MIME type of audio file | | AdditionalParameters | --options | Structure Of KeyAndValue | ✖ | Additional request parameters, if necessary | | AdditionalHeaders | --headers | Map Of KeyAndValue | ✖ | Additional request headers, if necessary | Returns: Map Of KeyAndValue - Processing result
:::tip Method at API documentation: [Create transcription](https://platform.openai.com/docs/api-reference/audio/createTranscription) Parameters with Binary data type can also accept file paths on disk and URLs :::
```bsl title="1C:Enterprise/OneScript code example" URL = "https://hut.openintegrations.dev/localai/"; Token = "12We..."; Audio = "C:\Users\bayse\AppData\Local\Temp\v8_8D28_24.wav"; Model = "whisper-1"; Result = OPI_OpenAI.CreateTranscription(URL, Token, Model, Audio, "audio/wav"); ``` ```bash oint openai CreateTranscription \ --url "https://hut.openintegrations.dev/localai/" \ --token "***" \ --model "whisper-1" \ --audio "/tmp/pypyif03.np5.wav" \ --type "audio/wav" ``` ```batch oint openai CreateTranscription ^ --url "https://hut.openintegrations.dev/localai/" ^ --token "***" ^ --model "whisper-1" ^ --audio "/tmp/pypyif03.np5.wav" ^ --type "audio/wav" ``` ```json title="Result" { "segments": [ { "id": 0, "start": 0, "end": 4480000000, "text": "Attack ships on fire off the shoulder of Orion Bright as magnesium.", "tokens": [ 50364, 22477, 11434, 322, 2610, 766, 264, 7948, 295, 41028, 24271, 382, 32950, 13, 50588 ] } ], "text": "Attack ships on fire off the shoulder of Orion Bright as magnesium." } ```