Docs
DocumentationQuery ReferenceAPI Reference
Open Console→→
DocumentationQuery ReferenceAPI Reference

Platform overview

What is Axiom?QuickstartArchitectureFeatures
Fundamentals
Datasets
Edge deployments
Limits
Performance
Optimize usage
Requirements
Semantic conventions
Glossary
Tour
SecurityRoadmap

Send data

Reference architecturesMethods

Understand data

Console
Query
Builder
Editor
Query results
Visualize
Traces
Metrics
Correlations
Save queries
Stream
Dashboard
Create
Elements
Create
Configure
Element types
Gauge
Heatmap
Log stream
Monitor list
Note
Pie chart
Scatter plot
Statistic
Table
Time series
Sections
Configure
Filter
Monitor
Overview
View status
Configure
Examples
Monitor types
Anomaly
Match
New values
Threshold
Alerting
Overview
Configure
Notifier types
Amp
ChatGPT Workspace Agent
Claude Code
Cursor
Custom Webhook
Discord
Email
incident.io
Jira Service Management
Microsoft Teams
Opsgenie
PagerDuty
Slack
Annotations
Command Menu
Manage
Datasets
Overview
Views
Virtual fields
Access
RBAC
Tokens
CLI
Organization
Labels
Audit log
Settings
Usage and billing
Profile
Extend
Overview
AWS Lambda
AWS PrivateLink
Cloudflare Workers
Cloudflare Logpush
Convex
Grafana
Hex
Netlify
Supabase
Supabase metrics
Tailscale
Terraform
Unkey
Vercel
Intelligence
Overview
Spotlight
AI agents
Overview
MCP Server
Overview
Tools
Query cost limits
Agent-created orgs
Skills
Overview
Axiom alerting
Build dashboards
Control costs
SRE
Translate SPL to APL
Splunk
Overview
Splunk app
Install and configure
Commands
Traces
Examples
Portal
How it works
Set up standard mode
Set up transparent mode
Observability Cloud
OCSF data
OCSF as CIM
SPL command support
Examples
Monitor and troubleshoot

Use cases

ObservabilityProduct analytics
OCSF security data
Overview
Send data
Query data
LLM observability
Overview
Use Vercel AI SDK
Manual instrumentation
OpenAI Agents SDK
GenAI attributes
Redaction policies

Miscellaneous

LLMs
Overview
List of docs pages
Full docs
Query reference
FAQs
Legal
Acceptable use policy
Axiom for Startups terms
Committed use terms
Cookies
Data processing
HIPAA
Partner agreement
Partner program guide
Privacy policy
SLA
Terms of service
Terms of use
Understand data/Console

Authenticate API requests with tokens

Learn how you can authenticate your requests to the Axiom API with tokens.

This reference article explains how you can authenticate your requests to the Axiom API with tokens.

Why authenticate with tokens

You can use the Axiom API and CLI to programmatically ingest and query data, and manage settings and resources. For example, you can create new API tokens and change existing datasets with API requests. To prove that these requests come from you, you must include forms of authentication called tokens in your API requests. Axiom offers two types of tokens:

  • API tokens let you control the actions that can be performed with the token. For example, you can specify that requests authenticated with a certain API token can only query data from a particular dataset.
  • Personal access tokens (PATs) provide full control over your Axiom account. Requests authenticated with a PAT can perform every action you can perform in Axiom. When possible, use API tokens instead of PATs.
Warning

Keep tokens confidential. Anyone with these forms of authentication can perform actions on your behalf such as sending data to your Axiom dataset.

When working with tokens, use the principle of least privilege:

  • Assign only those privileges to API tokens that are necessary to perform the actions that you want.
  • When possible, use API tokens instead of PATs because PATs have full control over your Axiom account.

For more information on how to use tokens in API requests, see Get started with Axiom API.

API tokens

You can use two types of API tokens in Axiom:

  • Basic API tokens let you ingest data to Axiom. When you create a basic API token, you select the datasets that you allow the basic API token to access.
  • Advanced API tokens let you perform a wide range of actions in Axiom beyond ingesting data. When you create an advanced API token, you select which actions you allow the advanced API token to perform. For example, you can create an advanced API token that can only query data from a particular dataset and another that has wider privileges such as creating datasets and changing existing monitors.

After creating an API token, you can’t change the privileges assigned to that API token.

Create basic API token

  1. Click Settings > API tokens, and then click New API token.
  2. Name your API token.
  3. Optional: Give a description to the API token and set an expiration date.
  4. In Permissions, click Basic.
  5. In Dataset access, select the datasets where this token can ingest data.
  6. Click Create token.
  7. Copy the API token that appears and store it securely. It won’t be displayed again.

Create advanced API token

  1. Click Settings > API tokens, and then click New API token.

  2. Name your API token.

  3. Optional: Give a description to the API token and set an expiration date.

  4. In Permissions, click Advanced.

  5. In Advanced permissions, choose one of the following options:

    • Select Custom and define your own permission set. In Datasets, select the actions the token can perform on all datasets, or click Add dataset to grant access to specific datasets. In Views, you can click Add view to grant the token access to specific views. In Organization, you can select the actions the token can perform that affect your whole Axiom organization. For example, creating users and changing existing notifiers.
    • Select one of the presets to auto-populate a predefined set of capabilities. For example, Preset - Evaluations allows an SDK to write evaluation traces and query comparison data, and Preset - Terraform grants capabilities to manage Axiom resources using Terraform.
  6. Click Create token.

  7. Copy the API token that appears and store it securely. It won’t be displayed again.

Create an API token with an AI agent

Axiom MCP Server lets your AI agent help you create an API token quickly and securely.

The prepareApiToken tool constructs a prefilled template in Axiom Console for you to review before creating the token yourself. By handing off token creation to you, it keeps the token value out of the conversation with the agent. Axiom recommends that you do not expose API tokens directly to AI agents.

To create an API token, follow these steps:

  1. Ask your AI agent to prepare an API token with the required permissions.
  2. Open the link, review the token details, and click Create token.
  3. Copy the API token and store it securely.

Limit query costs of an API token

You can cap the hourly and daily query costs of an API token, in dollars. When the token exceeds a limit, its query requests fail with HTTP status code 429 until the window resets. Ingest and other operations are unaffected. This is particularly useful for tokens you give to AI agents.

To set limits when you create a token, enter an hourly limit, a daily limit, or both in Query cost limits. To add or change limits on an existing token, click Settings > API tokens, select the token, and then edit Query cost limits. The token page shows the token’s current usage against each limit.

For more information, see Set query cost limits for AI agents.

View API token details and usage

In Settings > API tokens, search by token name or ID. You can also filter the token list by Created by, Created, Expiry (Expiring within 7 days, Expired, or Not expired), and Last used. Expired tokens remain in the list. Check Last used before replacing a token. For tokens used for both ingestion and other API requests, select the token to see each type of activity separately.

Axiom highlights tokens that expire within 7 days. For fine-grained tokens created with a lifetime of at least 7 days, Axiom also emails the creator before expiry. If the creator is no longer in the organization, Axiom emails the organization owners.

Regenerate API token

Recommended: Rotate API tokens regularly and set an expiration date after which the token becomes invalid.

Tokens with an expiration date can’t be regenerated. To replace an expiring or expired token, create a new API token and update your clients.

To regenerate a non-expiring, non-classic API token:

  1. Click Settings > API tokens.
  2. Click the API token to regenerate, and then click Regenerate token. Alternatively, open the actions menu next to the token in the list, and then select Regenerate token.
  3. Optional: In Expire previous token, choose a delay before the previous token stops working. In Expiration, choose an expiration date for the regenerated token.
  4. Click Regenerate.
  5. Copy the regenerated API token that appears and store it securely. It won’t be displayed again.
  6. Update all API requests that use the token with the regenerated value.

Delete API token

  1. Click Settings > API tokens.
  2. Click the API token to delete, and then click Delete token. Alternatively, open the actions menu next to the token in the list, and then select Delete token.
  3. Click Delete token to confirm.

Personal access tokens (PAT)

Personal access tokens (PATs) provide full control over your Axiom account. Requests authenticated with a PAT can perform every action you can perform in Axiom. When possible, use API tokens instead of PATs.

Create PAT

  1. Click Settings > Profile.
  2. In the Personal tokens section, click New token.
  3. Name the PAT.
  4. Optional: Give a description to the PAT.
  5. Click Save.
  6. Copy the PAT that appears and store it securely. It won’t be displayed again.

Delete PAT

  1. Click Settings > Profile.
  2. In the Personal tokens section, open the actions menu next to the PAT that you want to delete, and then select Delete.
  3. Click Delete token to confirm.

Determine organization ID

If you authenticate requests with a PAT, you must include the organization ID in the requests. API tokens don’t need the organization ID; if a request with an API token includes one, it must match the token’s organization. For more information on including the organization ID in the request, see Axiom API and Axiom CLI.

Determine the organization ID in one of the following ways:

  • Click Settings, and then copy the organization ID in the top right corner.
  • Click Settings > General, and then find the ID section.
  • Go to the Axiom app and check the URL. For example, in the URL https://app.axiom.co/axiom-abcd/datasets, the organization ID is axiom-abcd.
Was this page helpful?
Suggest edits on GitHub
PreviousRole-Based Access ControlNextAxiom CLI
On this page
Why authenticate with tokensAPI tokensCreate basic API tokenCreate advanced API tokenCreate an API token with an AI agentLimit query costs of an API tokenView API token details and usageRegenerate API tokenDelete API tokenPersonal access tokens (PAT)Create PATDelete PATDetermine organization ID