Hexel Studio uses API keys for authentication.
Getting Your API Key
- Log in to the Hexel Studio Dashboard
- Navigate to Settings → API Keys
- Click Create API Key
- Select the environment (Production, Development, etc.)
- Copy and securely store your key
API keys are shown only once. Store them securely and never commit them to version control.
API Key Structure
Your API key contains encoded information about:
- Organization ID
- Workspace ID
- Environment ID
The SDK automatically extracts this context from your key.
Using Your API Key
With the SDK
from hx import Client
client = Client() # Reads HX_API_KEY from environment
# Context is extracted from your key
print(client.org_id)
print(client.workspace_id)
print(client.environment_id)
With HTTP Requests
Include the API key in the Authorization header:
curl -X POST "https://api.hexelstudio.com/runtime/v1/knowledge-stores/{store_id}/search" \
-H "Authorization: Bearer $HX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "search query", "top_k": 5}'
Environment Variables
# Required
export HX_API_KEY="your-api-key"
# Optional - override base URL
export HX_BASE_URL="https://api.hexelstudio.com"
Multiple Environments
Create separate API keys for each environment:
| Environment | Key Usage |
|---|
| Production | Live user traffic |
| Development | Local development |
| Staging | Pre-production testing |
Switch environments by using different API keys:
# Development
export HX_API_KEY="dev-api-key"
# Production
export HX_API_KEY="prod-api-key"
Security Best Practices
- Never expose API keys in client-side code
- Use environment variables or secret managers
- Rotate keys periodically
- Use separate keys for each environment
- Monitor API key usage in the dashboard