---
title: "OpenAI"
method: POST
path: "/models/v2/openai/{model}"
---

# OpenAI

`POST /models/v2/openai/{model}`

Send requests to any OpenAI model by specifying the `{model}` placeholder in the path.

## Path parameters

- `model` string, required

## Request body

- UniversalRequestBodySchema
  - `text` string — Input text for NLP tasks.
  - `messages` Message[] — Conversation history.
    - `role` 'system' | 'user' | 'assistant', required
    - `content` union, required
      - string — Text-only message content.
      - object[] — Multi-modal content blocks.
        - `type` 'text' | 'image' | 'audio' | 'video', required
        - `text` string — Text when `type` is `text`.
        - `url` string, uri — HTTP URL to the media when `type` is image/audio/video.
        - `base64` string — Base64-encoded media when `type` is image/audio/video.
  - `url` string, uri — URL to image/audio/video.
  - `base64` string — Base64-encoded image/audio/video.
  - `question` string — Question (for QA tasks).
  - `context` string — Context paragraph (for QA tasks).
  - `candidate_labels` string[] — Candidate labels (for zero-shot).
  - `stream` boolean — Enable/disable text streaming.
  - `json` boolean — Stream media instead of JSON.
  - `params` ParamsProperty — Model-specific parameters.
    - `min_length` integer — Minimum response length.
    - `max_length` integer — Maximum response length.
    - `temperature` number — Sampling temperature.

## Response `200`

Successful response from the model.

- object
  - `error` string — Null if everything is fine
  - `output` union — Model output
    - string
    - object

---

[API](https://skmtc.net/bytez/apis/closed-source-model-api.md) · [All operations](https://skmtc.net/bytez/apis/closed-source-model-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bytez/closed-source-model-api/versions/d64c9c733afe/schema)
