POST
/
chat
/
completions
curl https://gateway.obiguard.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "x-obiguard-api-key: $OBIGUARD_API_KEY" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'
{
  "id": "<string>",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 123,
      "message": {
        "content": "<string>",
        "tool_calls": [
          {
            "id": "<string>",
            "type": "function",
            "function": {
              "name": "<string>",
              "arguments": "<string>"
            }
          }
        ],
        "role": "assistant",
        "function_call": {
          "arguments": "<string>",
          "name": "<string>"
        },
        "content_blocks": [
          {
            "type": "text",
            "text": "<string>"
          }
        ]
      },
      "logprobs": {
        "content": [
          {
            "token": "<string>",
            "logprob": 123,
            "bytes": [
              123
            ],
            "top_logprobs": [
              {
                "token": "<string>",
                "logprob": 123,
                "bytes": [
                  123
                ]
              }
            ]
          }
        ]
      }
    }
  ],
  "created": 123,
  "model": "<string>",
  "system_fingerprint": "<string>",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

x-obiguard-api-key
string
header
required

Body

application/json

Response

200 - application/json

OK

Represents a chat completion response returned by model, based on the provided input.