Skip to main content
POST
/
v1
/
chat
/
completions
Generate completion
curl --request POST \
  --url https://api.sierra.absconsulting.com/v1/chat/completions \
  --header 'Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "messages": [
    {
      "content": "<string>",
      "role": "system"
    }
  ],
  "model": "<string>"
}
'
{
  "choices": [
    {
      "delta": {
        "content": "<string>",
        "role": "system"
      },
      "finish_reason": "<string>",
      "index": 123,
      "message": {
        "content": "<string>",
        "role": "system"
      }
    }
  ],
  "created": 123,
  "id": "<string>",
  "model": "<string>",
  "object": "<string>",
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}

Authorizations

Api-Key
string
header
required

Access the API as yourself. You can find your API key in your profile menu in Portal.

Headers

X-Project-Code
string

The GEMS number of a project this request is associated with. Currently, this is only used for Royal Caribbean Group. Use 'NA' or leave blank if not associated with a specific project.

Body

application/json

The completion request.

messages
object[]
required

The messages array passed to the model. Messages are in the format of [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the capital of France?"}].

model
string
required

The model to use for completion.

max_completion_tokens
integer

The maximum number of tokens the model can generate in the completion response.

response_format
object

The response format to use for completion.

stream
boolean

If true, the response will be streamed back as it is generated, allowing for real-time output. If false, the complete response is returned after generation finishes.

temperature
number

Controls the randomness of the model's output. Lower values (e.g., 0.2) make the output more deterministic and focused, while higher values (e.g., 1.0) make it more creative and varied. The accepted range typically is dependent on the model. It is often between 0.0-2.0. Model-specific defaults apply if not provided.

Response

OK

choices
object[]

The choices for the completion.

created
integer

The timestamp of the completion.

id
string

The ID of the completion.

model
string

The model used for the completion.

object
string

The object type.

usage
object

The usage for the completion.