API keys
What are aiXplain API Keys?
There are two types of API keys:
-
Admin API Keys
Admin API keys are for configuring and monitor rate limits. These keys are solely for management and cannot be used for inference. Learn more in the How to configure model rate limiting guide. -
Member API Keys
Member API Keys (or API Keys for short) allow you to call aiXplain assets and services outside of Studio. E.g. via the aiXplain SDK or HTTP requests. See examples below.
Manage API Keys
Create and delete API keys for any given team in its Integrations page.
The Integrations page
Access the Integrations page using the dropdown next to your name.


Creating an API Key
- Clicking the Create an access key button.
- Specify an API key name (Label), type (Type) and expiration duration (Active days).


- Copy and safely story your generated key.


Use (Member) API Keys
- SDK
- HTTP (Curl)
Set an API key as an environment variable when using the aiXplain SDK.
See more details in the Python and Swift quickstarts.
- MacOS / Linux
- Windows
- Python (os module)
- Xcode
export AIXPLAIN_API_KEY="your_api_key_here"
setx AIXPLAIN_API_KEY="your_api_key_here"
import os
os.environ["AIXPLAIN_API_KEY"] = "your_api_key_here"
AiXplainKit.shared.keyManager.AIXPLAIN_API_KEY = "<your_api_key_here>"
Include an API key in the request header when using the aiXplain API directly.
See more details in the API Requests quickstart.
- Agent
- Model
- Pipeline
curl -X POST 'https://platform-api.aixplain.com/sdk/agents/<agent_id>/run' \
-H 'x-api-key: <your_api_key_here>' \
-H 'Content-Type: application/json' \
-d '{
"query": "<QUERY_DATA>",
"sessionId": "<SESSION_ID_DATA>"
}'
curl -X POST 'https://models.aixplain.com/api/v1/execute/<model_id>' \
-H 'x-api-key: <your_api_key_here>' \
-H 'Content-Type: application/json' \
-d '{"data": "Your input data"}'
curl -X POST 'https://platform-api.aixplain.com/assets/pipeline/execution/run/<pipeline_id>' \
-H 'x-api-key: <your_api_key_here>' \
-H 'Content-Type: application/json' \
-d '{
"Input 1": "<INPUT_1_DATA>",
"Input 2": "<INPUT_1_DATA>"
}'