Skip to main content
API keys let you access OneTest programmatically — from CI/CD pipelines, test automation frameworks, scripts, and integrations.

Overview

OneTest supports two authentication methods:
MethodUse CaseMetering
Browser session (JWT)UI access via browserFree
API keyProgrammatic / REST accessMetered (coins)
API key requests consume coins from your product’s weekly budget. Browser usage is always free. See Usage & Billing for details.

Creating an API Key

1

Go to Settings

Navigate to Settings > API Keys in the OneTest UI
2

Create New Key

Click ”+ Create API Key” and give it a descriptive name (e.g., “CI Pipeline”, “Test Reporter”)
3

Copy the Key

Copy the API key immediately — it is only shown once and cannot be retrieved later
4

Store Securely

Store the key in your CI/CD secrets, environment variables, or secrets manager
API keys are shown only once at creation. If you lose a key, you’ll need to create a new one and update all integrations that use it.

API Key Format

OneTest API keys use the ak_ prefix:
ak_R2HSAH1DBQ8Q9B8PKSR165V7W0BVDRQP
This prefix allows OneTest to automatically distinguish API keys from JWT session tokens.

Using API Keys

Include the API key in the Authorization header:
curl -X GET https://tms.onetest.ai/api/gateway/api/v1/tools \
  -H "Authorization: Bearer ak_R2HSAH1DBQ8Q9B8PKSR165V7W0BVDRQP" \
  -H "Content-Type: application/json"

Examples

# List test cases
curl https://tms.onetest.ai/api/test-management/api/v1/products/{product_id}/test-cases \
  -H "Authorization: Bearer ak_YOUR_KEY_HERE"

# Create a test case
curl -X POST https://tms.onetest.ai/api/test-management/api/v1/products/{product_id}/test-cases \
  -H "Authorization: Bearer ak_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"title": "Login test", "test_type": "manual", "priority": "p2"}'

API Key vs Browser Session

AspectAPI KeyBrowser Session
Formatak_... (opaque token)JWT from Clerk
DurationUntil revokedSession-based
MeteringCoins per requestFree
Use caseCI/CD, scripts, agentsInteractive UI
Rate limitConfigurable per productNone

Revoking Keys

To revoke an API key:
  1. Go to Settings > API Keys
  2. Find the key you want to revoke
  3. Click Revoke
  4. The key stops working within 5 minutes
Revoked keys are cached for up to 5 minutes. For immediate effect during a security incident, contact support.

Best Practices

Use Descriptive Names

Name keys after their purpose: “GitHub CI”, “Nightly Reporter”, “Jenkins Pipeline”

One Key Per Integration

Create separate keys for each integration so you can revoke them independently

Store in Secrets Manager

Never hardcode keys in source code. Use CI/CD secrets or a vault

Monitor Usage

Check the Usage & Billing page to spot unexpected consumption

Supported Services

API keys work with all OneTest services:
ServiceBase PathPurpose
Gateway/api/gateway/AI assistant, tools
Membership/api/membership/Products, environments, builds
Test Management/api/test-management/Test cases, runs, executions
Artifacts/api/artifacts/File storage, documents
Receiver/api/receiver/Test result ingestion