Portkey Audio API

Turn audio into text or text into audio.

OpenAPI Specification

portkey-audio-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Portkey Analytics > Graphs Audio API
  description: The Portkey REST API. Please see https://portkey.ai/docs/api-reference for more details.
  version: 2.0.0
  termsOfService: https://portkey.ai/terms
  contact:
    name: Portkey Developer Forum
    url: https://portkey.wiki/community
  license:
    name: MIT
    url: https://github.com/Portkey-AI/portkey-openapi/blob/master/LICENSE
servers:
- url: https://api.portkey.ai/v1
  description: Portkey API Public Endpoint
security:
- Portkey-Key: []
tags:
- name: Audio
  description: Turn audio into text or text into audio.
paths:
  /audio/speech:
    servers:
    - url: https://api.portkey.ai/v1
      description: Portkey API Public Endpoint
    - url: SELF_HOSTED_GATEWAY_URL
      description: Self-Hosted Gateway URL
    post:
      operationId: createSpeech
      tags:
      - Audio
      summary: Create Speech
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSpeechRequest'
      responses:
        '200':
          description: OK
          headers:
            Transfer-Encoding:
              schema:
                type: string
              description: chunked
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
      security:
      - Portkey-Key: []
        Virtual-Key: []
      - Portkey-Key: []
        Provider-Auth: []
        Provider-Name: []
      - Portkey-Key: []
        Config: []
      - Portkey-Key: []
        Provider-Auth: []
        Provider-Name: []
        Custom-Host: []
      x-code-samples:
      - lang: curl
        label: Default
        source: "curl https://api.portkey.ai/v1/audio/speech \\\n  -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n  -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"tts-1\",\n    \"input\": \"The quick brown fox jumped over the lazy dog.\",\n    \"voice\": \"alloy\"\n  }' \\\n  --output speech.mp3\n"
      - lang: python
        label: Default
        source: "from pathlib import Path\nfrom portkey_ai import Portkey\n\nclient = Portkey(\n  api_key = \"PORTKEY_API_KEY\",\n  virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nspeech_file_path = Path(__file__).parent / \"speech.mp3\"\nresponse = client.audio.speech.create(\n  model=\"tts-1\",\n  voice=\"alloy\",\n  input=\"The quick brown fox jumped over the lazy dog.\"\n)\nresponse.stream_to_file(speech_file_path)\n"
      - lang: javascript
        label: Default
        source: "import fs from \"fs\";\nimport path from \"path\";\nimport Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n  apiKey: 'PORTKEY_API_KEY',\n  virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nconst speechFile = path.resolve(\"./speech.mp3\");\n\nasync function main() {\n  const mp3 = await client.audio.speech.create({\n    model: \"tts-1\",\n    voice: \"alloy\",\n    input: \"Today is a wonderful day to build something people love!\",\n  });\n  console.log(speechFile);\n  const buffer = Buffer.from(await mp3.arrayBuffer());\n  await fs.promises.writeFile(speechFile, buffer);\n}\nmain();\n"
      - lang: curl
        label: Self-Hosted
        source: "curl -X POST \"SELF_HOSTED_GATEWAY_URL/audio/speech\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n  -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n  -d '{\n    \"model\": \"tts-1\",\n    \"input\": \"The quick brown fox jumped over the lazy dog.\",\n    \"voice\": \"alloy\"\n  }' \\\n  --output speech.mp3\n"
      - lang: python
        label: Self-Hosted
        source: "from pathlib import Path\nfrom portkey_ai import Portkey\n\nclient = Portkey(\n  api_key = \"PORTKEY_API_KEY\",\n  virtual_key = \"PROVIDER_VIRTUAL_KEY\",\n  base_url=\"SELF_HOSTED_GATEWAY_URL\"\n)\n\nspeech_file_path = Path(__file__).parent / \"speech.mp3\"\nresponse = client.audio.speech.create(\n  model=\"tts-1\",\n  voice=\"alloy\",\n  input=\"The quick brown fox jumped over the lazy dog.\"\n)\nresponse.stream_to_file(speech_file_path)\n"
      - lang: javascript
        label: Self-Hosted
        source: "import fs from \"fs\";\nimport path from \"path\";\nimport Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n  apiKey: 'PORTKEY_API_KEY',\n  virtualKey: 'PROVIDER_VIRTUAL_KEY',\n  baseUrl: 'SELF_HOSTED_GATEWAY_URL'\n});\n\nconst speechFile = path.resolve(\"./speech.mp3\");\n\nasync function main() {\n  const mp3 = await client.audio.speech.create({\n    model: \"tts-1\",\n    voice: \"alloy\",\n    input: \"Today is a wonderful day to build something people love!\",\n  });\n  console.log(speechFile);\n  const buffer = Buffer.from(await mp3.arrayBuffer());\n  await fs.promises.writeFile(speechFile, buffer);\n}\nmain();\n"
  /audio/transcriptions:
    servers:
    - url: https://api.portkey.ai/v1
      description: Portkey API Public Endpoint
    - url: SELF_HOSTED_GATEWAY_URL
      description: Self-Hosted Gateway URL
    post:
      operationId: createTranscription
      tags:
      - Audio
      summary: Create Transcription
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateTranscriptionRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/CreateTranscriptionResponseJson'
                - $ref: '#/components/schemas/CreateTranscriptionResponseVerboseJson'
      security:
      - Portkey-Key: []
        Virtual-Key: []
      - Portkey-Key: []
        Provider-Auth: []
        Provider-Name: []
      - Portkey-Key: []
        Config: []
      - Portkey-Key: []
        Provider-Auth: []
        Provider-Name: []
        Custom-Host: []
      x-code-samples:
      - lang: curl
        label: Default
        source: "curl https://api.portkey.ai/v1/audio/transcriptions \\\n  -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n  -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n  -H \"Content-Type: multipart/form-data\" \\\n  -F file=\"@/path/to/file/audio.mp3\" \\\n  -F model=\"whisper-1\"\n"
      - lang: python
        label: Default
        source: "from portkey_ai import Portkey\n\nclient = Portkey(\n  api_key = \"PORTKEY_API_KEY\",\n  virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\naudio_file = open(\"speech.mp3\", \"rb\")\ntranscript = client.audio.transcriptions.create(\n  model=\"whisper-1\",\n  file=audio_file\n)\n"
      - lang: javascript
        label: Default
        source: "import fs from \"fs\";\nimport Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n  apiKey: 'PORTKEY_API_KEY',\n  virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n  const transcription = await client.audio.transcriptions.create({\n    file: fs.createReadStream(\"audio.mp3\"),\n    model: \"whisper-1\",\n  });\n\n  console.log(transcription.text);\n}\nmain();\n"
      - lang: curl
        label: Self-Hosted
        source: "curl -X POST \"SELF_HOSTED_GATEWAY_URL/audio/transcriptions\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n  -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n  -d '{\n    \"model\": \"whisper-1\",\n    \"file\": \"@/path/to/file/audio.mp3\"\n  }' \\\n  --output transcription.json\n"
      - lang: python
        label: Self-Hosted
        source: "from portkey_ai import Portkey\n\nclient = Portkey(\n  api_key = \"PORTKEY_API_KEY\",\n  virtual_key = \"PROVIDER_VIRTUAL_KEY\",\n  base_url=\"SELF_HOSTED_GATEWAY_URL\"\n)\n\naudio_file = open(\"speech.mp3\", \"rb\")\ntranscript = client.audio.transcriptions.create(\n  model=\"whisper-1\",\n  file=audio_file\n)\n"
      - lang: javascript
        label: Self-Hosted
        source: "import fs from \"fs\";\nimport Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n  apiKey: 'PORTKEY_API_KEY',\n  virtualKey: 'PROVIDER_VIRTUAL_KEY',\n  baseUrl: 'SELF_HOSTED_GATEWAY_URL'\n});\n\nconst audioFile = fs.createReadStream(\"speech.mp3\");\n\nasync function main() {\n  const transcription = await client.audio.transcriptions.create({\n    file: audioFile,\n    model: \"whisper-1\",\n  });\n\n  console.log(transcription.text);\n}\nmain();\n"
  /audio/translations:
    servers:
    - url: https://api.portkey.ai/v1
      description: Portkey API Public Endpoint
    - url: SELF_HOSTED_GATEWAY_URL
      description: Self-Hosted Gateway URL
    post:
      operationId: createTranslation
      tags:
      - Audio
      summary: Create Translation
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateTranslationRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/CreateTranslationResponseJson'
                - $ref: '#/components/schemas/CreateTranslationResponseVerboseJson'
      security:
      - Portkey-Key: []
        Virtual-Key: []
      - Portkey-Key: []
        Provider-Auth: []
        Provider-Name: []
      - Portkey-Key: []
        Config: []
      - Portkey-Key: []
        Provider-Auth: []
        Provider-Name: []
        Custom-Host: []
      x-code-samples:
      - lang: curl
        label: Default
        source: "curl https://api.portkey.ai/v1/audio/translations \\\n  -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n  -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n  -H \"Content-Type: multipart/form-data\" \\\n  -F file=\"@/path/to/file/german.m4a\" \\\n  -F model=\"whisper-1\"\n"
      - lang: python
        label: Default
        source: "from portkey_ai import Portkey\n\nclient = Portkey(\n  api_key = \"PORTKEY_API_KEY\",\n  virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\naudio_file = open(\"speech.mp3\", \"rb\")\ntranscript = client.audio.translations.create(\n  model=\"whisper-1\",\n  file=audio_file\n)\n"
      - lang: javascript
        label: Default
        source: "import fs from \"fs\";\nimport Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n  apiKey: 'PORTKEY_API_KEY',\n  virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n    const translation = await client.audio.translations.create({\n        file: fs.createReadStream(\"speech.mp3\"),\n        model: \"whisper-1\",\n    });\n\n    console.log(translation.text);\n}\nmain();\n"
      - lang: curl
        label: Self-Hosted
        source: "curl -X POST \"SELF_HOSTED_GATEWAY_URL/audio/translations\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n  -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n  -d '{\n    \"model\": \"whisper-1\",\n    \"file\": \"@/path/to/file/german.m4a\"\n  }' \\\n  --output translation.json\n"
      - lang: python
        label: Self-Hosted
        source: "from portkey_ai import Portkey\n\nclient = Portkey(\n  api_key = \"PORTKEY_API_KEY\",\n  virtual_key = \"PROVIDER_VIRTUAL_KEY\",\n  base_url=\"SELF_HOSTED_GATEWAY_URL\"\n)\n\naudio_file = open(\"speech.mp3\", \"rb\")\ntranscript = client.audio.translations.create(\n  model=\"whisper-1\",\n  file=audio_file\n)\n"
      - lang: javascript
        label: Self-Hosted
        source: "import fs from \"fs\";\nimport Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n  apiKey: 'PORTKEY_API_KEY',\n  virtualKey: 'PROVIDER_VIRTUAL_KEY',\n  baseUrl: 'SELF_HOSTED_GATEWAY_URL'\n});\n\nconst audioFile = fs.createReadStream(\"speech.mp3\");\n\nasync function main() {\n  const translation = await client.audio.translations.create({\n    file: audioFile,\n    model: \"whisper-1\",\n  });\n\n  console.log(translation.text);\n}\nmain();\n"
components:
  schemas:
    CreateTranscriptionResponseVerboseJson:
      type: object
      description: Represents a verbose json transcription response returned by model, based on the provided input.
      properties:
        language:
          type: string
          description: The language of the input audio.
        duration:
          type: string
          description: The duration of the input audio.
        text:
          type: string
          description: The transcribed text.
        words:
          type: array
          description: Extracted words and their corresponding timestamps.
          items:
            $ref: '#/components/schemas/TranscriptionWord'
        segments:
          type: array
          description: Segments of the transcribed text and their corresponding details.
          items:
            $ref: '#/components/schemas/TranscriptionSegment'
      required:
      - language
      - duration
      - text
    CreateTranslationResponseJson:
      type: object
      properties:
        text:
          type: string
      required:
      - text
    CreateSpeechRequest:
      type: object
      additionalProperties: false
      properties:
        model:
          description: 'One of the available [TTS models](https://platform.openai.com/docs/models/tts): `tts-1` or `tts-1-hd`

            '
          anyOf:
          - type: string
          - type: string
            enum:
            - tts-1
            - tts-1-hd
          x-oaiTypeLabel: string
        input:
          type: string
          description: The text to generate audio for. The maximum length is 4096 characters.
          maxLength: 4096
        voice:
          description: The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are available in the [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech/voice-options).
          type: string
          enum:
          - alloy
          - echo
          - fable
          - onyx
          - nova
          - shimmer
        response_format:
          description: The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.
          default: mp3
          type: string
          enum:
          - mp3
          - opus
          - aac
          - flac
          - wav
          - pcm
        speed:
          description: The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default.
          type: number
          default: 1.0
          minimum: 0.25
          maximum: 4.0
      required:
      - model
      - input
      - voice
    CreateTranslationRequest:
      type: object
      additionalProperties: false
      properties:
        file:
          description: 'The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

            '
          type: string
          x-oaiTypeLabel: file
          format: binary
        model:
          description: 'ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.

            '
          example: whisper-1
          anyOf:
          - type: string
          - type: string
            enum:
            - whisper-1
          x-oaiTypeLabel: string
        prompt:
          description: 'An optional text to guide the model''s style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting) should be in English.

            '
          type: string
        response_format:
          description: 'The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.

            '
          type: string
          default: json
        temperature:
          description: 'The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.

            '
          type: number
          default: 0
      required:
      - file
      - model
    TranscriptionWord:
      type: object
      properties:
        word:
          type: string
          description: The text content of the word.
        start:
          type: number
          format: float
          description: Start time of the word in seconds.
        end:
          type: number
          format: float
          description: End time of the word in seconds.
      required:
      - word
      - start
      - end
    TranscriptionSegment:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier of the segment.
        seek:
          type: integer
          description: Seek offset of the segment.
        start:
          type: number
          format: float
          description: Start time of the segment in seconds.
        end:
          type: number
          format: float
          description: End time of the segment in seconds.
        text:
          type: string
          description: Text content of the segment.
        tokens:
          type: array
          items:
            type: integer
          description: Array of token IDs for the text content.
        temperature:
          type: number
          format: float
          description: Temperature parameter used for generating the segment.
        avg_logprob:
          type: number
          format: float
          description: Average logprob of the segment. If the value is lower than -1, consider the logprobs failed.
        compression_ratio:
          type: number
          format: float
          description: Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed.
        no_speech_prob:
          type: number
          format: float
          description: Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent.
      required:
      - id
      - seek
      - start
      - end
      - text
      - tokens
      - temperature
      - avg_logprob
      - compression_ratio
      - no_speech_prob
    CreateTranscriptionResponseJson:
      type: object
      description: Represents a transcription response returned by model, based on the provided input.
      properties:
        text:
          type: string
          description: The transcribed text.
      required:
      - text
    CreateTranscriptionRequest:
      type: object
      additionalProperties: false
      properties:
        file:
          description: 'The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

            '
          type: string
          x-oaiTypeLabel: file
          format: binary
        model:
          description: 'ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`.

            '
          example: whisper-1
          anyOf:
          - type: string
          - type: string
            enum:
            - whisper-1
          x-oaiTypeLabel: string
        language:
          description: 'The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency.

            '
          type: string
        prompt:
          description: 'An optional text to guide the model''s style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting) should match the audio language.

            '
          type: string
        response_format:
          description: 'The format of the transcript output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`.

            '
          type: string
          enum:
          - json
          - text
          - srt
          - verbose_json
          - vtt
          default: json
        temperature:
          description: 'The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.

            '
          type: number
          default: 0
        timestamp_granularities[]:
          description: 'The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.

            '
          type: array
          items:
            type: string
            enum:
            - word
            - segment
          default:
          - segment
      required:
      - file
      - model
    CreateTranslationResponseVerboseJson:
      type: object
      properties:
        language:
          type: string
          description: The language of the output translation (always `english`).
        duration:
          type: string
          description: The duration of the input audio.
        text:
          type: string
          description: The translated text.
        segments:
          type: array
          description: Segments of the translated text and their corresponding details.
          items:
            $ref: '#/components/schemas/TranscriptionSegment'
      required:
      - language
      - duration
      - text
  securitySchemes:
    Portkey-Key:
      type: apiKey
      in: header
      name: x-portkey-api-key
    Virtual-Key:
      type: apiKey
      in: header
      name: x-portkey-virtual-key
    Provider-Auth:
      type: http
      scheme: bearer
    Provider-Name:
      type: apiKey
      in: header
      name: x-portkey-provider
    Config:
      type: apiKey
      in: header
      name: x-portkey-config
    Custom-Host:
      type: apiKey
      in: header
      name: x-portkey-custom-host
x-server-groups:
  ControlPlaneServers:
  - url: https://api.portkey.ai/v1
    description: Portkey API Public Endpoint
  - url: SELF_HOSTED_CONTROL_PLANE_URL
    description: Self-Hosted Control Plane URL
  DataPlaneServers:
  - url: https://api.portkey.ai/v1
    description: Portkey API Public Endpoint
  - url: SELF_HOSTED_GATEWAY_URL
    description: Self-Hosted Gateway URL
  PublicServers:
  - url: https://api.portkey.ai
    description: Portkey Public API (no auth required)
x-mint:
  mcp:
    enabled: true
    name: Portkey MCP
    description: Official MCP Server for Portkey Docs & APIs
x-code-samples:
  navigationGroups:
  - id: endpoints
    title: Endpoints
  - id: assistants
    title: Assistants
  - id: legacy
    title: Legacy
  groups:
  - id: audio
    title: Audio
    description: 'Learn how to turn audio into text or text into audio.


      Related guide: [Speech to text](https://platform.openai.com/docs/guides/speech-to-text)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createSpeech
      path: createSpeech
    - type: endpoint
      key: createTranscription
      path: createTranscription
    - type: endpoint
      key: createTranslation
      path: createTranslation
    - type: object
      key: CreateTranscriptionResponseJson
      path: json-object
    - type: object
      key: CreateTranscriptionResponseVerboseJson
      path: verbose-json-object
  - id: chat
    title: Chat
    description: 'Given a list of messages comprising a conversation, the model will return a response.


      Related guide: [Chat Completions](https://platform.openai.com/docs/guides/text-generation)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createChatCompletion
      path: create
    - type: object
      key: CreateChatCompletionResponse
      path: object
    - type: object
      key: CreateChatCompletionStreamResponse
      path: streaming
  - id: realtime
    title: Realtime
    description: 'WebSocket proxy for provider Realtime APIs (`GET` upgrade). Use `wss://` with the same `/v1` data-plane base as other gateway routes.


      Related guide: [OpenAI Realtime API](https://platform.openai.com/docs/guides/realtime)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: connectRealtime
      path: connect
  - id: embeddings
    title: Embeddings
    description: 'Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.


      Related guide: [Embeddings](https://platform.openai.com/docs/guides/embeddings)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createEmbedding
      path: create
    - type: object
      key: Embedding
      path: object
  - id: rerank
    title: Rerank
    description: 'Rerank a list of documents based on their relevance to a query. Reranking improves search results by scoring documents based on semantic relevance rather than keyword matching.


      Supported providers: Cohere, Voyage, Jina, Pinecone, Bedrock, Azure AI.

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createRerank
      path: create
    - type: object
      key: CreateRerankResponse
      path: object
  - id: fine-tuning
    title: Fine-tuning
    description: 'Manage fine-tuning jobs to tailor a model to your specific training data.


      Related guide: [Fine-tune models](https://platform.openai.com/docs/guides/fine-tuning)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createFineTuningJob
      path: create
    - type: endpoint
      key: listPaginatedFineTuningJobs
      path: list
    - type: endpoint
      key: listFineTuningEvents
      path: list-events
    - type: endpoint
      key: listFineTuningJobCheckpoints
      path: list-checkpoints
    - type: endpoint
      key: retrieveFineTuningJob
      path: retrieve
    - type: endpoint
      key: cancelFineTuningJob
      path: cancel
    - type: object
      key: FinetuneChatRequestInput
      path: chat-input
    - type: object
      key: FinetuneCompletionRequestInput
      path: completions-input
    - type: object
      key: FineTuningJob
      path: object
    - type: object
      key: FineTuningJobEvent
      path: event-object
    - type: object
      key: FineTuningJobCheckpoint
      path: checkpoint-object
  - id: batch
    title: Batch
    description: 'Create large batches of API requests for asynchronous processing. The Batch API returns completions within 24 hours for a 50% discount.


      Related guide: [Batch](https://platform.openai.com/docs/guides/batch)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createBatch
      path: create
    - type: endpoint
      key: retrieveBatch
      path: retrieve
    - type: endpoint
      key: cancelBatch
      path: cancel
    - type: endpoint
      key: listBatches
      path: list
    - type: object
      key: Batch
      path: object
    - type: object
      key: BatchRequestInput
      path: request-input
    - type: object
      key: BatchRequestOutput
      path: request-output
  - id: files
    title: Files
    description: 'Files are used to upload documents that can be used with features like [Assistants](https://platform.openai.com/docs/api-reference/assistants), [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning), and [Batch API](https://platform.openai.com/docs/guides/batch).

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createFile
      path: create
    - type: endpoint
      key: listFiles
      path: list
    - type: endpoint
      key: retrieveFile
      path: retrieve
    - type: endpoint
      key: deleteFile
      path: delete
    - type: endpoint
      key: downloadFile
      path: retrieve-contents
    - type: object
      key: OpenAIFile
      path: object
  - id: images
    title: Images
    description: 'Given a prompt and/or an input image, the model will generate a new image.


      Related guide: [Image generation](https://platform.openai.com/docs/guides/images)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createImage
      path: create
    - type: endpoint
      key: createImageEdit
      path: createEdit
    - type: endpoint
      key: createImageVariation
      path: createVariation
    - type: object
      key: Image
      path: object
  - id: models
    title: Models
    description: 'List and describe the various models available in the API. You can refer to the [Models](https://platform.openai.com/docs/models) documentation to understand what models are available and the differences between them.

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: listModels
      path: list
    - type: endpoint
      key: retrieveModel
      path: retrieve
    - type: endpoint
      key: deleteModel
      path: delete
    - type: object
      key: Model
      path: object
  - id: moderations
    title: Moderations
    description: 'Given some input text, outputs if the model classifies it as potentially harmful across several categories.


      Related guide: [Moderations](https://platform.openai.com/docs/guides/moderation)

      '
    navigationGroup: endpoints
    sections:
    - type: endpoint
      key: createModeration
      path: create
    - type: object
      key: CreateModerationResponse
      path: object
  - id: assistants
    title: Assistants
    beta: true
    description: 'Build assistants that can call models and use tools to perform tasks.


      [Get started with the Assistants API](https://platform.openai.com/docs/assistants)

      '
    navigationGroup: assistants
    sections:
    - type: endpoint
      key: createAssistant
      path: createAssistant
    - type: endpoint
      key: listAssistants
      path: listAssistants
    - type: endpoint
      key: getAssistant
      path: getAssistant
    - type: endpoint
      key: modifyAssistant
      path: modifyAssistant
    - type: endpoint
      key: deleteAssistant
      path: deleteAssistant
    - type: object
      key: AssistantObject
      path: object
  - id: threads
    title: Threads
    beta: true
    description: 'Create threads that assistants can interact with.


      Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview)

      '
    navigationGroup: assistants
    sections:
    - type: endpoint
      key: createThread
      path: createThread
    - type: endpoint
      key: getThread
      path: getThread
    - type: endpoint
      key: modifyThread
      path: modifyThread
    - type: endpoint
      key: deleteThread
      path: deleteThread
    - type: object
      key: ThreadObject
      path: object
  - id: messages
    title: Messages
    beta: true
    description: 'Create messages within threads


      Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview)

      '
    navigationGroup: assistants
    sections:
    - type: endpoint
      key: createMessage
      path: createMessage
    - type: endpoint
      key: listMessages
      path: listMessages
    - type: endpoint
      key: getMessage
      path: getMessage
    - type: endpoint
      key: modifyMessage
      path: modifyMessage
    - type: endpoint
      key: deleteMessage
      path: deleteMessage
    - type: object
      key: MessageObject
      path: object
  - id: runs
    title: Runs
    beta: true
    description: 'Represents an execution run on a thread.


      Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview)

      '
    navigationGroup: assistants
    sections:
    - type: endpoint
      key: createRun
      path: createRun
    - type: endpoint
      key: createThreadAndRun
      path: createThreadAndRun
    - type: endpoint
      key: listRuns
      path: listRuns
    - type: endpoint
      key: getRun
      path: getRun
    - type: endpoint
      key: modifyRun
      path: modifyRun
    - type: endpoint
      key: submitToolOuputsToRun
      path: submitToo

# --- truncated at 32 KB (36 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/portkey/refs/heads/main/openapi/portkey-audio-api-openapi.yml