Skip to main content
POST
/
v0
/
ingest
JavaScript
import Avido from 'avido';

const client = new Avido({
  apiKey: process.env['AVIDO_API_KEY'], // This is the default and can be omitted
  applicationID: process.env['AVIDO_APPLICATION_ID'], // This is the default and can be omitted
});

const ingest = await client.ingest.create({
  events: [
    { type: 'trace' },
    {
      event: 'start',
      input: [{ role: 'user', content: 'Tell me a joke.' }],
      modelId: 'gpt-4o-2024-08-06',
      type: 'llm',
    },
  ],
});

console.log(ingest.data);
import os
from avido import Avido

client = Avido(
    api_key=os.environ.get("AVIDO_API_KEY"),  # This is the default and can be omitted
    application_id=os.environ.get("AVIDO_APPLICATION_ID"),  # This is the default and can be omitted
)
ingest = client.ingest.create(
    events=[{
        "type": "trace"
    }, {
        "event": "start",
        "input": [{
            "role": "user",
            "content": "Tell me a joke.",
        }],
        "model_id": "gpt-4o-2024-08-06",
        "type": "llm",
    }],
)
print(ingest.data)
curl --request POST \
  --url https://api.avidoai.com/v0/ingest \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-application-id: <api-key>' \
  --data '
{
  "events": [
    {
      "type": "trace",
      "timestamp": "2025-01-01T12:00:00Z",
      "referenceId": "123e4567-e89b-12d3-a456-426614174000",
      "metadata": {
        "source": "chatbot"
      }
    },
    {
      "type": "llm",
      "event": "start",
      "traceId": "123e4567-e89b-12d3-a456-426614174000",
      "timestamp": "2025-01-01T12:01:00Z",
      "modelId": "gpt-4o-2024-08-06",
      "params": {
        "temperature": 1.2
      },
      "input": [
        {
          "role": "user",
          "content": "Tell me a joke."
        }
      ]
    }
  ]
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.avidoai.com/v0/ingest",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'events' => [
        [
                'type' => 'trace',
                'timestamp' => '2025-01-01T12:00:00Z',
                'referenceId' => '123e4567-e89b-12d3-a456-426614174000',
                'metadata' => [
                                'source' => 'chatbot'
                ]
        ],
        [
                'type' => 'llm',
                'event' => 'start',
                'traceId' => '123e4567-e89b-12d3-a456-426614174000',
                'timestamp' => '2025-01-01T12:01:00Z',
                'modelId' => 'gpt-4o-2024-08-06',
                'params' => [
                                'temperature' => 1.2
                ],
                'input' => [
                                [
                                                                'role' => 'user',
                                                                'content' => 'Tell me a joke.'
                                ]
                ]
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-api-key: <api-key>",
    "x-application-id: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.avidoai.com/v0/ingest"

	payload := strings.NewReader("{\n  \"events\": [\n    {\n      \"type\": \"trace\",\n      \"timestamp\": \"2025-01-01T12:00:00Z\",\n      \"referenceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n      \"metadata\": {\n        \"source\": \"chatbot\"\n      }\n    },\n    {\n      \"type\": \"llm\",\n      \"event\": \"start\",\n      \"traceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n      \"timestamp\": \"2025-01-01T12:01:00Z\",\n      \"modelId\": \"gpt-4o-2024-08-06\",\n      \"params\": {\n        \"temperature\": 1.2\n      },\n      \"input\": [\n        {\n          \"role\": \"user\",\n          \"content\": \"Tell me a joke.\"\n        }\n      ]\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<api-key>")
	req.Header.Add("x-application-id", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.avidoai.com/v0/ingest")
  .header("x-api-key", "<api-key>")
  .header("x-application-id", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"events\": [\n    {\n      \"type\": \"trace\",\n      \"timestamp\": \"2025-01-01T12:00:00Z\",\n      \"referenceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n      \"metadata\": {\n        \"source\": \"chatbot\"\n      }\n    },\n    {\n      \"type\": \"llm\",\n      \"event\": \"start\",\n      \"traceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n      \"timestamp\": \"2025-01-01T12:01:00Z\",\n      \"modelId\": \"gpt-4o-2024-08-06\",\n      \"params\": {\n        \"temperature\": 1.2\n      },\n      \"input\": [\n        {\n          \"role\": \"user\",\n          \"content\": \"Tell me a joke.\"\n        }\n      ]\n    }\n  ]\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.avidoai.com/v0/ingest")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-application-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"events\": [\n    {\n      \"type\": \"trace\",\n      \"timestamp\": \"2025-01-01T12:00:00Z\",\n      \"referenceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n      \"metadata\": {\n        \"source\": \"chatbot\"\n      }\n    },\n    {\n      \"type\": \"llm\",\n      \"event\": \"start\",\n      \"traceId\": \"123e4567-e89b-12d3-a456-426614174000\",\n      \"timestamp\": \"2025-01-01T12:01:00Z\",\n      \"modelId\": \"gpt-4o-2024-08-06\",\n      \"params\": {\n        \"temperature\": 1.2\n      },\n      \"input\": [\n        {\n          \"role\": \"user\",\n          \"content\": \"Tell me a joke.\"\n        }\n      ]\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "success": true,
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "error": "Failed to write to database"
    }
  ]
}
{
  "message": "Resource not found"
}
{
  "message": "Resource not found"
}
{
  "message": "Resource not found"
}
{
  "message": "Invalid request data",
  "issues": [
    {
      "code": "invalid_string",
      "message": "Invalid UUID",
      "path": [
        "id"
      ]
    }
  ]
}
{
  "message": "Resource not found"
}

Authorizations

x-api-key
string
header
required

Your unique Avido API key

x-application-id
string
header
required

Your unique Avido Application ID

Body

application/json

Request schema for ingesting events into the system.

events
Ingest Event · object[]
required

Array of events to be ingested, which can be traces or steps.

An event represents one step in the interaction with your AI application, such as a RAG call, reranker, tool call, LLM trigger, agent orchestration, embedding, guardrail check, evaluator, response, or user request.

Example:
[
  {
    "type": "trace",
    "timestamp": "2025-01-01T12:00:00Z",
    "referenceId": "123e4567-e89b-12d3-a456-426614174000",
    "metadata": { "source": "chatbot" }
  },
  {
    "type": "llm",
    "event": "start",
    "traceId": "123e4567-e89b-12d3-a456-426614174000",
    "timestamp": "2025-01-01T12:01:00Z",
    "modelId": "gpt-4o-2024-08-06",
    "params": { "temperature": 1.2 },
    "input": [
      {
        "role": "user",
        "content": "Tell me a joke."
      }
    ]
  }
]

Response

Successfully ingested events.

Response schema for successful event ingestion.

data
object[]
required

Array of results for each ingested event.