POST
/
v1
/
chat
/
completions
curl --request POST \
  --url https://api.galadriel.com/v1/chat/completions \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "messages": [
    {
      "content": "You are a helpful assistant.",
      "role": "system"
    },
    {
      "content": "Hello!",
      "role": "user"
    }
  ],
  "model": "llama3.1"
}'
{
  "id": "id",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null,
      "message": {
        "content": "Hello. It's nice to meet you. Is there something I can help you with or would you like to chat?",
        "refusal": null,
        "role": "assistant",
        "function_call": null,
        "tool_calls": null
      }
    }
  ],
  "created": 1728558433,
  "model": "neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8",
  "object": "chat.completion",
  "service_tier": null,
  "system_fingerprint": null
}
{
  "id": "id",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null,
      "message": {
        "content": "Hello. It's nice to meet you. Is there something I can help you with or would you like to chat?",
        "refusal": null,
        "role": "assistant",
        "function_call": null,
        "tool_calls": null
      }
    }
  ],
  "created": 1728558433,
  "model": "neuralmagic/Meta-Llama-3.1-8B-Instruct-FP8",
  "object": "chat.completion",
  "service_tier": null,
  "system_fingerprint": null
}

Authorizations

Authorization
string
header
required

Bearer authentication header.

example value: Bearer Galadriel-API-key

Get API key from Galadriel dashboard.

Body

application/json

Response

200
application/json

Returns a chat completion object, or a streamed sequence of chat completion chunk objects if the request is streamed.

The response is of type object.