---
title: "Proxy to OpenAI-Compatible Chat Completions"
method: POST
path: "/api/llm/openai/chat/completions"
tags: ["LLM"]
---

# Proxy to OpenAI-Compatible Chat Completions

`POST /api/llm/openai/chat/completions`

Proxy requests to OpenAI-compatible chat completions APIs and return the full response payload. Supports multiple providers via model parameter format: "model_name" (defaults to OpenAI), "provider/model_name", or "provider:model_name". Works with providers that offer OpenAI-compatible endpoints.

## Request body

- ChatCompletionRequestRequest — Validates and sanitizes chat completion request payload. Ensures: - messages is a list of valid message dictionaries - Each message conforms to role-specific requirements - Only allowed fields are included in the sanitized output
  - `messages` ChatMessageRequest[], required — Array of message objects forming the conversation
    - `content` unknown
    - `role` 'user' | 'developer' | 'system' | 'assistant' | 'tool', required — * `user` - user * `developer` - developer * `system` - system * `assistant` - assistant * `tool` - tool
    - `tool_call_id` string, nullable — The ID of the tool call this message is responding to
    - `tool_calls` unknown[], nullable — Tool calls made by the assistant
      - unknown
  - `model` string, required — Model identifier in format "provider/model-name" (e.g., "openai/gpt-4")

## Response `200`

- unknown

## Other responses

- `400`

---

[API](https://skmtc.net/humansignal/apis/label-studio-api.md) · [All operations](https://skmtc.net/humansignal/apis/label-studio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/humansignal/label-studio-api/versions/1b113b8df950/schema)
