Ir al contenido

OpenAI Chat Completions, answered by Polar

POST/api/v1/chat/completions

For OpenAI-compatible clients: base URL is the origin plus /api/v1. Needs polar.use.

Necesita una clave de API en la cabecera Authorization.

En esta página

Cuerpo

CampoTipoDescripción
modelobligatoriostring
Esquema JSON
{
  "type": "object",
  "properties": {
    "model": {
      "type": "string"
    }
  },
  "required": [
    "model"
  ]
}

Petición de ejemplo

curl -X POST "https://polaris.example.com/api/v1/chat/completions" \
  -H "Authorization: Bearer $POLARIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "string"
}'

Respuestas

EstadoQué es
200OK

También puede dar los errores comunes 400, 401, 403, 404, 429. Ver errores comunes