Skip to main content
Contacts are an entity used to tie metrics within the orq.ai APIs. They can represent:
  • a User
  • a Team
  • a Project
  • a Client
Contacts are Created through the API and then are used as supplementary data to store Contact Metrics within any other call of the API.

Creating a contact using the Studio

To create a Contact, head to the Contact Analytics section and choose Create a Contact. The following panel opens:

Budget Control

When creating a contact, set a Budget in order to:
  • Prevent individual users from exceeding the allocated AI budget
  • Set department-level spending limits for the enterprise team
  • Control costs across multiple AI models and service

See the current spending of a contact by viewing their detail

Creating a contact using the API

To create a contact, you have two options:
  1. Use the API directly: You can create a Contact with the cURL code snippet.
  2. SDK Implementation: (Recommended) The SDK provides a more streamlined approach to creating Contacts.

curl --location 'https://api.orq.ai/v2/contacts' \
--header 'Authorization: Bearer <your-api-key>:' \
--header 'Content-Type: application/json' \
--data-raw '{
    "external_id": "1234",
    "display_name": "Client A",
    "email": "[email protected]",
    "avatar_url": "https://gravatar.com/avatar/6c568aaa96fdbd3e466b500e6eb312dc?s=400&d=robohash&r=x",
    "metadata": {
      "role": "admin"
    }
}'
Developers, please see the API Reference for further explanation.

Using Contact metrics

To track Contact metrics effectively, you have two primary options:
  1. API Direct Usage: When using the API directly, you can attach the contact ID through the request headers.
  2. SDK Implementation: We strongly recommend using our SDKs, as they provide a more streamlined approach to tracking contact metrics.
curl 'https://api.orq.ai/v2/deployments/invoke' \
-H 'Authorization: Bearer {apiKey}' \
-H 'X-ORQ-CONTACT-ID: <external_id>' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
   "key": "<deployment_key>",
   "context": {
      "environments": []
   }
}' \
--compressed
To learn more, see the API Reference.