> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galadriel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Sentience SDK is designed to be compatible with OpenAI's client libraries, making it easy to use your existing workflows but with an added benefit of prooving that the inference was made as is.

<Info>
  This API does not support streaming yet.
</Info>

<Info>
  [Sentience](https://github.com/galadriel-ai/sentience) repository is open-source
</Info>

![](https://raw.githubusercontent.com/galadriel-ai/Sentience/refs/heads/main/assets/SDK.png)

<Steps>
  <Step title="Sign up to get an API key">
    1. Create an account [here](https://dashboard.galadriel.com)
    2. Create an API key on the dashboard
  </Step>

  <Step title="Install the Python SDK">
    ```sh theme={null}
    pip install sentience
    ```
  </Step>

  <Step title="Call the verified inference API">
    Run the following code

    <CodeGroup>
      ```python Python theme={null}
      from openai import OpenAI

      client = OpenAI(
          base_url="https://api.galadriel.com/v1/verified",
          api_key=GALADRIEL_API_KEY
      )

      completion = client.chat.completions.create(
          model="gpt-4o",
          messages=[
              {"role": "system", "content": "You are a helpful assistant."},
              {"role": "user", "content": "Hello!"}
          ]
      )

      print(f"Message: {completion.choices[0].message}")
      print(f"Hash: {completion.hash}")
      print(f"Signed public key: {completion.public_key}")
      print(f"Signature: {completion.signature}")
      print(f"Tx hash: {completion.tx_hash}")
      print(f"Attestation: {completion.attestation}")

      ```

      ```javascript Javascript theme={null}
      import OpenAI from "openai";

      const openai = new OpenAI({
        apiKey: process.env.GALADRIEL_API_KEY,
        baseURL: "https://api.galadriel.com/v1/verified",
      });

      const completion = await openai.chat.completions.create({
        model: "gpt-4o",
        messages: [
          { role: "system", content: "You are a helpful assistant." },
          { role: "user", content: "Hello!" },
        ],
      });

      console.log(`Message: ${completion.choices[0].message}`);
      console.log(`Hash: ${completion.hash}`);
      console.log(`Signed public key: ${completion.public_key}`);
      console.log(`Signature: ${completion.signature}`);
      console.log(`Tx hash: ${completion.tx_hash}`);
      console.log(`Attestation: ${completion.attestation}`);
      ```

      ```bash cURL theme={null}
      curl -X 'POST' \
        'https://api.galadriel.com/v1/verified/chat/completions' \
        -H 'accept: application/json' \
        -H 'Authorization: Bearer $GALADRIEL_API_KEY' \
        -H 'Content-Type: application/json' \
        -d '{
        "model": "gpt-4o",
        "messages": [
          {
            "content": "You are a helpful assistant.",
            "role": "system"
          },
          {
            "content": "Hello!",
            "role": "user"
          }
        ]
      }'
      ```
    </CodeGroup>
  </Step>

  <Step title="Get history of all your verified inference calls">
    ```python theme={null}
    from typing import List
    import sentience
    from sentience.history import GaladrielChatHistory

    history: List[GaladrielChatHistory] = sentience.get_history(
        galadriel_api_key="Bearer GALADRIEL_API_KEY", filter="mine"
    )
    ```
  </Step>

  <Step title="Get history of all verified inference calls">
    ```python theme={null}
    from typing import List
    import sentience
    from sentience.history import GaladrielChatHistory

    history: List[GaladrielChatHistory] = sentience.get_history(
        galadriel_api_key="Bearer GALADRIEL_API_KEY"
    )
    ```
  </Step>

  <Step title="Get history for one verified inference call">
    ```python theme={null}
    import sentience
    from sentience.history import GaladrielChatHistory

    item: GaladrielChatHistory = sentience.get_by_hash(
        galadriel_api_key="Bearer GALADRIEL_API_KEY",
        # example hash, replace with your own:
        hash="922e575ef7f07449977001c1caaf78fb6ad8b731cd625434f9215087a6c2b39f"
    )
    ```
  </Step>

  <Step title="(Optional) Open the explorer to see the history">
    [Explorer](https://explorer.galadriel.com/) shows all the verified inference calls done on Galadriel platform.

    [Explorer Detailed View](https://explorer.galadriel.com/details/d5320c7aa1ffd93eee0a212937cc5fdf04a96ce27cf11cf158e0b29899428365) shows all the details for one verified inference call
  </Step>
</Steps>

### What's next?

* To see more details about sentience SDK, check out the [open-source repository](https://github.com/galadriel-ai/sentience)
* To see more details about the API check out the full [API docs](/api-reference/proof-of-sentience-API)
* To see how it all works [How TEE Works](/for-agents-developers/how-tee-works)
* To see how to verify the signatures [Verify Signatures](/for-agents-developers/verify-signatures)
* To see how to verify the attestation [Verify Attestation](/for-agent-developers/verify-attestation)
