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

# Log via API Request

<Info>
  **Using OpenAI with Python?** Just follow our [quick
  start](api-reference/logging/overview#quick-start) guide to get started in
  just a few lines of code.
</Info>

<Info>
  **Using LiteLLM?** Follow [this guide](/api-reference/logging/lite-llm) to get
  set up in just a few lines of code.
</Info>

You can log your inference calls to Athina via a simple API request. The logging request should be made just after you receive a response from the LLM.

* **Method**: `POST`
* **Endpoint**: `https://log.athina.ai/api/v2/log/inference`
* **Headers**:

  * `athina-api-key`: YOUR\_ATHINA\_API\_KEY
  * `Content-Type`: `application/json`

***

<Tip>
  Tip: To avoid adding any latency to your application, log your inference as a
  fire-and-forget request.
</Tip>

<RequestExample>
  ```js Request Body
  {
      // required fields
      "language_model_id": "gpt-4",
      "prompt": [
          {
              "role": "user",
              "content": "Which spaceship was first to land on the moon?"
          }
      ],
      "response": "The Apollo 11 was the first spaceship to land on the moon.",
  }
  ```
</RequestExample>

<ParamField body="language_model_id" type="string" required initialValue="gpt-4o" example="gpt-4o" defaultValue="gpt-4o" placeholder="gpt-4o">
  Identifier for the language model used for inference. This is just a string
  label, all models are supported.
</ParamField>

<ParamField body="prompt" type="string | {role: string, content: string}[]" initialValue="asdasdasdasd" example="Hello, how are you?">
  The prompt sent for inference. This can be either a `string` or the `messages`
  array sent to OpenAI. Note that in case of Tool message content can be either
  string or array.
</ParamField>

<ParamField body="response" type="string" required>
  The response from the LLM. This should be a `string`.
</ParamField>

### Logging Attributes

See the full list of [available fields for logging](/api-reference/logging/logging-attributes) here.
