POST
https://api.galadriel.com
/
v1
/
verified
/
chat
/
completions
curl --request POST \
  --url https://api.galadriel.com/v1/verified/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": "gpt-4o"
}'
{
  "id": "id",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null,
      "message": {
        "content": "Hello! How can I assist you today?",
        "refusal": null,
        "role": "assistant",
        "function_call": null,
        "tool_calls": null,
        "audio": null
      }
    }
  ],
  "created": 1728558433,
  "model": "gpt-4o-2024-08-06",
  "object": "chat.completion",
  "service_tier": null,
  "system_fingerprint": "fp_9faba9f038",
  "usage": {
    "completion_tokens": 9,
    "prompt_tokens": 19,
    "total_tokens": 28,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 0,
      "audio_tokens": 0,
      "reasoning_tokens": 0,
      "rejected_prediction_tokens": 0
    },
    "prompt_tokens_details": {
      "audio_tokens": 0,
      "cached_tokens": 0
    }
  },
  "hash": "2c88aacb88de8b85a23e648eff20941285c16bb63cf9467811ee15bb64a40445",
  "public_key": "Dp2k554Ebsij5RjuhjsZujVW2bJnQzfb43VYZSQ4NZo1",
  "signature": "f298c3b1294221d1200041993818cfbfec66f33d1071ea821e5068978099cd60179dbf66839570dd9ada5f661e7d8475a03b536f42e540db3bed6f21d5741301",
  "tx_hash": "e495424c395c501fb8fc013738fb481be85c1fbce9e595c308c31792983b2ffa10eca9c7dda0c8768ce12d0ff49a089cd5068d847eea8ae7544d5435d7f6010d",
  "attestation": "enclave attestation"
}
{
  "id": "id",
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null,
      "message": {
        "content": "Hello! How can I assist you today?",
        "refusal": null,
        "role": "assistant",
        "function_call": null,
        "tool_calls": null,
        "audio": null
      }
    }
  ],
  "created": 1728558433,
  "model": "gpt-4o-2024-08-06",
  "object": "chat.completion",
  "service_tier": null,
  "system_fingerprint": "fp_9faba9f038",
  "usage": {
    "completion_tokens": 9,
    "prompt_tokens": 19,
    "total_tokens": 28,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 0,
      "audio_tokens": 0,
      "reasoning_tokens": 0,
      "rejected_prediction_tokens": 0
    },
    "prompt_tokens_details": {
      "audio_tokens": 0,
      "cached_tokens": 0
    }
  },
  "hash": "2c88aacb88de8b85a23e648eff20941285c16bb63cf9467811ee15bb64a40445",
  "public_key": "Dp2k554Ebsij5RjuhjsZujVW2bJnQzfb43VYZSQ4NZo1",
  "signature": "f298c3b1294221d1200041993818cfbfec66f33d1071ea821e5068978099cd60179dbf66839570dd9ada5f661e7d8475a03b536f42e540db3bed6f21d5741301",
  "tx_hash": "e495424c395c501fb8fc013738fb481be85c1fbce9e595c308c31792983b2ffa10eca9c7dda0c8768ce12d0ff49a089cd5068d847eea8ae7544d5435d7f6010d",
  "attestation": "enclave attestation"
}

Authorizations

Authorization
string
header
required

Bearer authentication header.

example value: Bearer Galadriel-API-key

Get API key from Galadriel dashboard.

Headers

Fine-Tune-Authorization
string

Optional bearer authentication header for calling a fine-tuned model hosted on external service like OpenAI or Anthropic.

When a fine-tuned model is provided in the model field in body, you must pass the authentication key which has the access to that model.

The header should be in the format eg. Bearer OpenAI-API-Key.

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.