POST
/
v1
/
sql
/
query
cURL
curl --request POST \
  --url https://api.lmnr.ai/v1/sql/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "SELECT name, input_tokens FROM spans WHERE start_time > now() - interval '\''1 hour'\'' LIMIT 10"
}'
{
  "data": [
    {
      "name": "workflow",
      "input_tokens": 0
    },
    {
      "name": "openai.chat",
      "input_tokens": 369
    }
  ]
}

SQL Query

You can run SQL queries on your data stored in Laminar using the SQL query API. Learn more in the SQL Editor reference.

Example request

{
    "query": "SELECT * FROM spans where start_time > now() - interval '1 hour' LIMIT 10"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Response

200
application/json

SQL query executed successfully

The response is of type object.