Skip to main content
Every request to Hexel Studio is authenticated with a short-lived Bearer token. You provide an API key or OAuth client credentials, and Hexel exchanges them for a token and refreshes it automatically.

Authentication methods

Hexel supports two credential types: an API key for development and quick scripts, and OAuth client credentials for production services that need scoped, rotatable secrets. Create both in the Console under IAM → Service Users.

API key

Provide the key and the client handles token exchange and refresh.

OAuth client credentials

Recommended for production and any server-to-server integration.

Token exchange flow

1

Provide credentials

Send an API key (X-API-Key header) or client credentials (grant_type=client_credentials) to POST https://sts.hexelstudio.com/token.
2

Receive tokens

STS returns a Bearer token (access_token) and a refresh token.
3

Authenticate requests

Send Authorization: Bearer <token> on every API request.

Token response

string
Short-lived Bearer token. Valid for 15 minutes.
string
Used to obtain a new access token without re-authenticating.
integer
Seconds until the access token expires (900).
string
Always Bearer.
The SDKs and CLI cache the token and refresh it automatically before expiry. If you call the REST API directly with curl, re-exchange your credentials when the token expires.

Environment variables

The SDKs and CLI read these automatically:

Base URLs

Service endpoints for direct API use. The SDKs and CLI route to these automatically.

Common mistakes

  • Hardcoding keys in source. Use environment variables or a secret manager.
  • Sharing one key across environments. Use a separate key per environment to limit blast radius.
  • Using API keys in production services. Prefer OAuth client credentials for server-to-server traffic.
  • Embedding keys in client-side code. Credentials must never reach a browser or mobile client.

Best practices

  • Rotate keys periodically and immediately if one is exposed.
  • Scope credentials to the narrowest workspace and environment needed.
  • Store secrets in a managed secret store, not in version control.
  • Let the SDKs manage token refresh rather than handling tokens yourself.

API Keys

Create and manage API keys.

Service Accounts

Set up OAuth clients for production.

Organizations

How org, workspace, and environment scoping works.

Quickstart

Make your first authenticated request.

Next steps

Continue to First Deployment to take an agent from image to live endpoint.