{
// 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.",
}
Logging LLM Inferences
Log via API Request
POST
/
api
/
v2
/
log
/
inference
{
// 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.",
}
Using OpenAI with Python? Just follow our quick
start guide to get started in
just a few lines of code.
Using LiteLLM? Follow this guide to get
set up in just a few lines of code.
-
Method:
POST -
Endpoint:
https://log.athina.ai/api/v2/log/inference -
Headers:
athina-api-key: YOUR_ATHINA_API_KEYContent-Type:application/json
Tip: To avoid adding any latency to your application, log your inference as a
fire-and-forget request.
{
// 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.",
}
string
required
Identifier for the language model used for inference. This is just a string
label, all models are supported.
string | {role: string, content: string}[]
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.string
required
The response from the LLM. This should be a
string.