---
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 | &#x2714; | OpenAI server URL |
  | Token | --token | String | &#x2714; | OpenAI authorization token |
  | Model | --model | String | &#x2714; | Models name |
  | Audio | --audio | String, BinaryData | &#x2714; | Audio file |
  | MIME | --type | String | &#x2716; | MIME type of audio file |
  | AdditionalParameters | --options | Structure Of KeyAndValue | &#x2716; | Additional request parameters, if necessary |
  | AdditionalHeaders | --headers | Map Of KeyAndValue | &#x2716; | 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
:::
<br/>


```bsl title="1C:Enterprise/OneScript code example"
    URL   = "https://hut.openintegrations.dev/localai/";
    Token = "12We...";

    Audio = "C:\Users\bayse\AppData\Local\Temp\v8_1649_1f.wav";
    Model = "whisper-1";

    Result = OPI_OpenAI.CreateTranscription(URL, Token, Model, Audio, "audio/wav");
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint openai CreateTranscription \
             --url "https://hut.openintegrations.dev/localai/" \
             --token "***" \
             --model "whisper-1" \
             --audio "/tmp/ixu0tcts.qx1.wav" \
             --type "audio/wav"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint openai CreateTranscription ^
             --url "https://hut.openintegrations.dev/localai/" ^
             --token "***" ^
             --model "whisper-1" ^
             --audio "/tmp/ixu0tcts.qx1.wav" ^
             --type "audio/wav"
        ```
    </TabItem>
</Tabs>


```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,
    2690,
    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."
}
```
