POST
/
v0
/
queries
curl --request POST \
  --url 'https://api.unify.ai/v0/queries' \
  --header "Authorization: Bearer $UNIFY_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "endpoint": "llama-3.1-8b-chat_ollama@external",
    "query_body": {
        "max_tokens": 100,
        "messages": [
            {
                "content": "You are an useful assistant",
                "role": "system"
            },
            {
                "content": "Explain who Newton was.",
                "role": "user"
            }
        ],
        "model": "llama-3.1-8b-chat_ollama@external",
        "temperature": 0.5
    },
    "response_body": {
        "choices": [
            {
                "finish_reason": "stop",
                "index": 0,
                "message": {
                    "content": "Sir Isaac Newton was an English mathematician, physicist, and astronomer who lived from 1643 to 1727.\\n\\nHe is widely recognized as one of the most influential scientists in history, and his work laid the foundation for the Scientific Revolution of the 17th century.\\n\\nNewton's most famous achievement is his theory of universal gravitation, which he presented in his groundbreaking book \"Philosophi\\u00e6 Naturalis Principia Mathematica\" in 1687.\\n\\nAccording to Newton's theory, every",
                    "role": "assistant"
                }
            }
        ],
        "created": 1725396241,
        "id": "chatcmpl-92d3b36e-7b64-4ae8-8102-9b7e3f5dd30f",
        "model": "meta.llama3-8b-instruct-v1:0",
        "object": "chat.completion",
        "usage": {
            "completion_tokens": 100,
            "prompt_tokens": 44,
            "total_tokens": 144
        }
    },
    "timestamp": "2024-07-12T04:20:32.808410"
}'
{}

Authorizations

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

Body

endpoint
string
required
Endpoint to log query for.
query_body
object
required
A JSON object containing the body of the request
response_body
object | null
An optional JSON object containing the response to the request
tags
array | null
Tags for later filtering.
timestamp
string | null
A timestamp (if not set, will be the time of sending)
curl --request POST \
  --url 'https://api.unify.ai/v0/queries' \
  --header "Authorization: Bearer $UNIFY_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "endpoint": "llama-3.1-8b-chat_ollama@external",
    "query_body": {
        "max_tokens": 100,
        "messages": [
            {
                "content": "You are an useful assistant",
                "role": "system"
            },
            {
                "content": "Explain who Newton was.",
                "role": "user"
            }
        ],
        "model": "llama-3.1-8b-chat_ollama@external",
        "temperature": 0.5
    },
    "response_body": {
        "choices": [
            {
                "finish_reason": "stop",
                "index": 0,
                "message": {
                    "content": "Sir Isaac Newton was an English mathematician, physicist, and astronomer who lived from 1643 to 1727.\\n\\nHe is widely recognized as one of the most influential scientists in history, and his work laid the foundation for the Scientific Revolution of the 17th century.\\n\\nNewton's most famous achievement is his theory of universal gravitation, which he presented in his groundbreaking book \"Philosophi\\u00e6 Naturalis Principia Mathematica\" in 1687.\\n\\nAccording to Newton's theory, every",
                    "role": "assistant"
                }
            }
        ],
        "created": 1725396241,
        "id": "chatcmpl-92d3b36e-7b64-4ae8-8102-9b7e3f5dd30f",
        "model": "meta.llama3-8b-instruct-v1:0",
        "object": "chat.completion",
        "usage": {
            "completion_tokens": 100,
            "prompt_tokens": 44,
            "total_tokens": 144
        }
    },
    "timestamp": "2024-07-12T04:20:32.808410"
}'
{}