Management API
Accounts and Authorization
Create an API key
/auth/teams/{teamId}/api-keys
API keys are used to access the xAI API (https://api.x.ai). They are included on requests as a HTTP Bearer token. API keys are bound to teams and are associated with the user who created them.
Path Parameters
teamIdstringID of the team this API key belongs to. The team ID can be copied here: https://console.x.ai/team/default/settings/team.
Request Body
namestringHuman-readable name for the API key. Should not be empty.
Response Body
redactedApiKeystringA redacted API key. We don't expose the full key after it has been created.
apiKeystringOnly set when the API key is created.
userIdstringID of the User who created this API key.
namestringHuman-readable name for the API key.
createTimestringTimestamp when the API key was created.
modifyTimestringTimestamp when the API key was modified.
teamIdstringID of the team this API key belongs to.
apiKeyIdstringThe ID of the API key.
disabledbooleanIf API is disabled (by the user) or not. Users can disable API keys to prevent them from making API calls.
expireTimestringExpiration time for the API key. If set and in the past, the key is rejected.
qpsintegerIf set, this API key can only perform the stated number of requests per second.
qpmintegerIf set, this API key can only perform the stated number of requests per minute.
tpmstringIf set, the API key is limited to producing/consuming the set number of tokens per minute. The limiter engages when the limit is strictly exceeded. In-flight requests that cause the limit to get exceeded will not be aborted.
aclStringsarray<string>The permissions the API key has. By default, API keys don't have any permissions, which means all requests fail if this field is empty. There are two kind of permissions users can grant: (1) endpoints and (2) models via the `api-key:endpoint:[endpoint name]` and `api-key:model:[model name]` ACLs.
{
"name": "My API key",
"acls": [
"api-key:endpoint:*",
"api-key:model:*"
]
}{
"redactedApiKey": "xai-...oYZ4",
"apiKey": "xai-2xr2bnFV7lAbcdelZbqSxLd77pjlU6gcFmt3tPLSK3d7z7302htoH6mc4LlKlTY7nJtlU0lRXXQjoYZ4",
"userId": "6ad994df-7963-45e0-96c8-96b1ba849d9b",
"name": "My API key",
"createTime": "2025-11-13T16:14:38.164829Z",
"modifyTime": "2025-11-13T16:38:07.059039Z",
"teamId": "c9a0c990-53e6-491e-8df7-b9f18e6983ac",
"apiKeyId": "fe15b799-32e1-4d02-9e65-80236f9995f7",
"disabled": false,
"aclStrings": [
"api-key:endpoint:*",
"api-key:model:*"
]
}List API keys
/auth/teams/{teamId}/api-keys
Lists API keys belonging to a user within a team. If the caller user is an admin, returns all team API keys. If the caller user is a member, returns that user's API keys.
Path Parameters
teamIdstringID of the team whose API keys shall be listed.
Query Parameters
pageSizeintegerControl page size for result. It None, result is returned as one page.
paginationTokenstringPagination token received from a previous call when using pagination. Set to `undefined` to retrieve the first page.
aclFiltersarray<string>Optional filter to only return API keys that match the given ACLs.
activeOnlybooleanIf true, only return non-expired API keys. Defaults to false (return all keys).
Response Body
apiKeysarray<object>API keys belonging to the team.
paginationTokenstringInclude this token on a follow-up request to retrieve the next page. If `undefined`, this is the last page.
No parameters.{
"apiKeys": [
{
"redactedApiKey": "xai-a**b",
"userId": "12106c22-fa54-4255-9887-6eb73c55787f",
"apiKeyId": "faf5f6c2-5322-4793-9b74-23129addca0c",
"teamId": "fef05426-f6a4-4242-b9a6-b1a0ea5dc5fd",
"disabled": "false",
"tpm": "100000",
"acl_strings": [
"api-key:endpoint:*",
"api-key:model:*"
]
}
]
}Update an API key
/auth/api-keys/{api_key_id}
Selectively updates a subset of fields on an API key.
Path Parameters
api_key_idstringThe ID of the API key.
Request Body
Response Body
redactedApiKeystringA redacted API key. We don't expose the full key after it has been created.
apiKeystringOnly set when the API key is created.
userIdstringID of the User who created this API key.
namestringHuman-readable name for the API key.
createTimestringTimestamp when the API key was created.
modifyTimestringTimestamp when the API key was modified.
teamIdstringID of the team this API key belongs to.
apiKeyIdstringThe ID of the API key.
disabledbooleanIf API is disabled (by the user) or not. Users can disable API keys to prevent them from making API calls.
expireTimestringExpiration time for the API key. If set and in the past, the key is rejected.
qpsintegerIf set, this API key can only perform the stated number of requests per second.
qpmintegerIf set, this API key can only perform the stated number of requests per minute.
tpmstringIf set, the API key is limited to producing/consuming the set number of tokens per minute. The limiter engages when the limit is strictly exceeded. In-flight requests that cause the limit to get exceeded will not be aborted.
aclStringsarray<string>The permissions the API key has. By default, API keys don't have any permissions, which means all requests fail if this field is empty. There are two kind of permissions users can grant: (1) endpoints and (2) models via the `api-key:endpoint:[endpoint name]` and `api-key:model:[model name]` ACLs.
{
"apiKey": {
"tpm": "42"
},
"fieldMask": "tpm"
}{
"redactedApiKey": "xai-...oYZ4",
"apiKey": "xai-2xr2bnFV7lAbcdelZbqSxLd77pjlU6gcFmt3tPLSK3d7z7302htoH6mc4LlKlTY7nJtlU0lRXXQjoYZ4",
"userId": "6ad994df-7963-45e0-96c8-96b1ba849d9b",
"name": "My API key",
"createTime": "2025-11-13T16:14:38.164829Z",
"modifyTime": "2025-11-13T16:38:07.059039Z",
"teamId": "c9a0c990-53e6-491e-8df7-b9f18e6983ac",
"apiKeyId": "fe15b799-32e1-4d02-9e65-80236f9995f7",
"disabled": false,
"aclStrings": [
"api-key:endpoint:*",
"api-key:model:*"
]
}Rotate an API key
/auth/api-keys/{apiKeyId}/rotate
!!CAUTION!! Rotates the secret of an existing API key, permanently invalidating the old one.
Path Parameters
apiKeyIdstringID of the API key whose secret should be rotated.
Request Body
Response Body
redactedApiKeystringA redacted API key. We don't expose the full key after it has been created.
apiKeystringOnly set when the API key is created.
userIdstringID of the User who created this API key.
namestringHuman-readable name for the API key.
createTimestringTimestamp when the API key was created.
modifyTimestringTimestamp when the API key was modified.
teamIdstringID of the team this API key belongs to.
apiKeyIdstringThe ID of the API key.
disabledbooleanIf API is disabled (by the user) or not. Users can disable API keys to prevent them from making API calls.
expireTimestringExpiration time for the API key. If set and in the past, the key is rejected.
qpsintegerIf set, this API key can only perform the stated number of requests per second.
qpmintegerIf set, this API key can only perform the stated number of requests per minute.
tpmstringIf set, the API key is limited to producing/consuming the set number of tokens per minute. The limiter engages when the limit is strictly exceeded. In-flight requests that cause the limit to get exceeded will not be aborted.
aclStringsarray<string>The permissions the API key has. By default, API keys don't have any permissions, which means all requests fail if this field is empty. There are two kind of permissions users can grant: (1) endpoints and (2) models via the `api-key:endpoint:[endpoint name]` and `api-key:model:[model name]` ACLs.
No parameters.{
"redactedApiKey": "xai-...oYZ4",
"apiKey": "xai-2xr2bnFV7lAbcdelZbqSxLd77pjlU6gcFmt3tPLSK3d7z7302htoH6mc4LlKlTY7nJtlU0lRXXQjoYZ4",
"userId": "6ad994df-7963-45e0-96c8-96b1ba849d9b",
"name": "My API key",
"createTime": "2025-11-13T16:14:38.164829Z",
"modifyTime": "2025-11-13T16:38:07.059039Z",
"teamId": "c9a0c990-53e6-491e-8df7-b9f18e6983ac",
"apiKeyId": "fe15b799-32e1-4d02-9e65-80236f9995f7",
"disabled": false,
"aclStrings": [
"api-key:endpoint:*",
"api-key:model:*"
]
}Delete an API key
/auth/api-keys/{apiKeyId}
!!CAUTION!! Permanently and irrevocably deletes an API key.
Path Parameters
apiKeyIdstringID of the API key to delete.
No parameters.{}Check API key propagation
/auth/api-keys/{apiKeyId}/propagation
Checks if an API key has successfully been propagated.
Path Parameters
apiKeyIdstringID of the API whose propagation status shall be checked.
Response Body
icPropagationobjectMap from the Inference Cluster address to a flag indicating if the API key has propagated.
No parameters.{
"icPropagation": {
"cloud9.api.x.ai": true,
"us-east-1.api.x.ai": true
}
}List models
/auth/teams/{teamId}/models
Lists all models that are accessible by a team.
Path Parameters
teamIdstringID of the team whose models shall be retrieved.
Response Body
clusterConfigsarray<object>Contains the models accessible via the individual inference clusters.
No parameters.{
"clusterConfigs": [
{
"languageModels": [
{
"name": "grok-2-vision-1212",
"version": "1.0",
"inputModalities": [
"TEXT",
"IMAGE"
],
"outputModalities": [
"TEXT"
],
"promptTextTokenPrice": "20000",
"promptImageTokenPrice": "20000",
"promptTextTokenPriceLongContext": "0",
"cachedPromptTokenPrice": "0",
"completionTextTokenPrice": "100000",
"completionTokenPriceLongContext": "0",
"searchPrice": "0",
"rps": "10",
"rpm": "600",
"tpm": "0",
"cluster": "us-east-1",
"maxPromptLength": 32768,
"aliases": [
"grok-2-vision",
"grok-2-vision-latest"
],
"features": {
"functionCalling": true,
"structuredOutputs": true,
"reasoning": false
},
"algorithm": "MultimodalV1"
},
{
"name": "grok-code-fast-1",
"version": "1.0",
"inputModalities": [
"TEXT"
],
"outputModalities": [
"TEXT"
],
"promptTextTokenPrice": "2000",
"promptImageTokenPrice": "0",
"promptTextTokenPriceLongContext": "0",
"cachedPromptTokenPrice": "200",
"completionTextTokenPrice": "15000",
"completionTokenPriceLongContext": "0",
"searchPrice": "0",
"rps": "8",
"rpm": "480",
"tpm": "2000000",
"cluster": "us-east-1",
"maxPromptLength": 256000,
"aliases": [
"grok-code-fast",
"grok-code-fast-1-0825"
],
"features": {
"functionCalling": true,
"structuredOutputs": true,
"reasoning": true
},
"algorithm": "grok4Code"
},
{
"name": "grok-2-1212",
"version": "1.0",
"inputModalities": [
"TEXT"
],
"outputModalities": [
"TEXT"
],
"promptTextTokenPrice": "20000",
"promptImageTokenPrice": "0",
"promptTextTokenPriceLongContext": "0",
"cachedPromptTokenPrice": "0",
"completionTextTokenPrice": "100000",
"completionTokenPriceLongContext": "0",
"searchPrice": "0",
"rps": "15",
"rpm": "900",
"tpm": "0",
"cluster": "us-east-1",
"maxPromptLength": 131072,
"aliases": [
"grok-2",
"grok-2-latest"
],
"features": {
"functionCalling": true,
"structuredOutputs": true,
"reasoning": false
},
"algorithm": "MultimodalV1"
},
{
"name": "grok-3-mini",
"version": "1.0",
"inputModalities": [
"TEXT"
],
"outputModalities": [
"TEXT"
],
"promptTextTokenPrice": "3000",
"promptImageTokenPrice": "0",
"promptTextTokenPriceLongContext": "0",
"cachedPromptTokenPrice": "750",
"completionTextTokenPrice": "5000",
"completionTokenPriceLongContext": "0",
"searchPrice": "2500",
"rps": "8",
"rpm": "480",
"tpm": "0",
"cluster": "us-east-1",
"maxPromptLength": 131072,
"aliases": [
"grok-3-mini-latest",
"grok-3-mini-beta",
"grok-3-mini-fast",
"grok-3-mini-fast-latest",
"grok-3-mini-fast-beta"
],
"features": {
"functionCalling": true,
"structuredOutputs": true,
"reasoning": true
},
"algorithm": "grok3Reasoning"
},
{
"name": "grok-4-0709",
"version": "1.0",
"inputModalities": [
"TEXT"
],
"outputModalities": [
"TEXT"
],
"promptTextTokenPrice": "30000",
"promptImageTokenPrice": "30000",
"promptTextTokenPriceLongContext": "60000",
"cachedPromptTokenPrice": "7500",
"completionTextTokenPrice": "150000",
"completionTokenPriceLongContext": "300000",
"searchPrice": "2500",
"rps": "8",
"rpm": "480",
"tpm": "2000000",
"cluster": "us-east-1",
"maxPromptLength": 256000,
"aliases": [
"grok-4",
"grok-4-latest"
],
"features": {
"functionCalling": true,
"structuredOutputs": true,
"reasoning": true
},
"algorithm": "grok4",
"longContextThreshold": "128000"
},
{
"name": "grok-3",
"version": "1.0",
"inputModalities": [
"TEXT"
],
"outputModalities": [
"TEXT"
],
"promptTextTokenPrice": "30000",
"promptImageTokenPrice": "0",
"promptTextTokenPriceLongContext": "0",
"cachedPromptTokenPrice": "7500",
"completionTextTokenPrice": "150000",
"completionTokenPriceLongContext": "0",
"searchPrice": "2500",
"rps": "10",
"rpm": "600",
"tpm": "0",
"cluster": "us-east-1",
"maxPromptLength": 131072,
"aliases": [
"grok-3-latest",
"grok-3-beta",
"grok-3-fast",
"grok-3-fast-latest",
"grok-3-fast-beta"
],
"features": {
"functionCalling": true,
"structuredOutputs": true,
"reasoning": false
},
"algorithm": "grok3"
}
],
"embeddingModels": [],
"imageGenerationModels": [
{
"name": "grok-2-image-1212",
"version": "1.0",
"inputModalities": [
"TEXT",
"IMAGE"
],
"outputModalities": [
"IMAGE"
],
"imagePrice": "700000000",
"rps": "5",
"rpm": "300",
"tpm": "0",
"cluster": "us-east-1",
"aliases": [
"grok-2-image",
"grok-2-image-latest"
]
}
],
"audioModels": [],
"clusterName": "us-east-1"
},
{
"languageModels": [
{
"name": "grok-2-1212",
"version": "1.0",
"inputModalities": [
"TEXT"
],
"outputModalities": [
"TEXT"
],
"promptTextTokenPrice": "20000",
"promptImageTokenPrice": "0",
"promptTextTokenPriceLongContext": "0",
"cachedPromptTokenPrice": "0",
"completionTextTokenPrice": "100000",
"completionTokenPriceLongContext": "0",
"searchPrice": "0",
"rps": "50",
"tpm": "0",
"cluster": "eu-west-1",
"maxPromptLength": 131072,
"aliases": [
"grok-2",
"grok-2-latest"
],
"features": {
"functionCalling": true,
"structuredOutputs": true,
"reasoning": false
},
"algorithm": "MultimodalV1"
},
{
"name": "grok-2-vision-1212",
"version": "1.0",
"inputModalities": [
"TEXT",
"IMAGE"
],
"outputModalities": [
"TEXT"
],
"promptTextTokenPrice": "20000",
"promptImageTokenPrice": "20000",
"promptTextTokenPriceLongContext": "0",
"cachedPromptTokenPrice": "0",
"completionTextTokenPrice": "100000",
"completionTokenPriceLongContext": "0",
"searchPrice": "0",
"rps": "50",
"tpm": "0",
"cluster": "eu-west-1",
"maxPromptLength": 32768,
"aliases": [
"grok-2-vision",
"grok-2-vision-latest"
],
"features": {
"functionCalling": true,
"structuredOutputs": true,
"reasoning": false
},
"algorithm": "MultimodalV1"
}
],
"embeddingModels": [],
"imageGenerationModels": [],
"audioModels": [],
"clusterName": "eu-west-1"
}
]
}List possible endpoint ACL values
/auth/teams/{teamId}/endpoints
Lists all the endpoint ACLs that can be used on API keys.
Path Parameters
teamIdstringID of the team whose accessible endpoints shall be received.
Response Body
aclsarray<object>List of ACLs that can be assigned to an API key.
No parameters.{
"acls": [
{
"acl": "api-key:endpoint:chat",
"description": "Grants access to use a specific endpoint with an API Key.",
"namespace": "api-key",
"key": "endpoint",
"value": "chat"
},
{
"acl": "api-key:endpoint:embed",
"description": "Grants access to use a specific endpoint with an API Key.",
"namespace": "api-key",
"key": "endpoint",
"value": "embed"
},
{
"acl": "api-key:endpoint:image",
"description": "Grants access to use a specific endpoint with an API Key.",
"namespace": "api-key",
"key": "endpoint",
"value": "image"
},
{
"acl": "api-key:endpoint:models",
"description": "Grants access to use a specific endpoint with an API Key.",
"namespace": "api-key",
"key": "endpoint",
"value": "models"
},
{
"acl": "api-key:endpoint:sample",
"description": "Grants access to use a specific endpoint with an API Key.",
"namespace": "api-key",
"key": "endpoint",
"value": "sample"
},
{
"acl": "api-key:endpoint:tokenize",
"description": "Grants access to use a specific endpoint with an API Key.",
"namespace": "api-key",
"key": "endpoint",
"value": "tokenize"
},
{
"acl": "api-key:endpoint:documents",
"description": "Grants access to use a specific endpoint with an API Key.",
"namespace": "api-key",
"key": "endpoint",
"value": "documents"
}
]
}Validate management key
/auth/management-keys/validation
API endpoint for GET requests to /auth/management-keys/validation.
Response Body
apiKeyIdstringID of this key.
teamIdstring[DEPRECATED] Use scope and scope_id instead. ID of the team on whose behalf the key can act.
scope"SCOPE_UNSPECIFIED" | "SCOPE_TEAM" | "SCOPE_ORGANIZATION"Scope the key is associated with.
scopeIdstringID of the scope the key is associated with.
ownerUserIdstringID of the user who owns this key.
createTimestringTime when the key was created.
modifyTimestringTime when the key was last modified.
namestringName of this key (Just for humans).
aclsarray<string>ACLs of this key (controls what APIs can be accessed using the key).
apiKeystringOnly set when the key is created.
redactedApiKeystringA shorted version of the actual key.
ipRangesobjectNo parameters.{
"apiKeyId": "b86ba29d-9f47-4b3a-a6ae-e69432d5f0dc",
"teamId": "65c1e471-205f-4566-9c5a-07198badf4ce",
"scope": "SCOPE_TEAM",
"scopeId": "65c1e471-205f-4566-9c5a-07198badf4ce",
"ownerUserId": "4d52c406-6ec6-4361-9b7c-40dc7e8ff284",
"createTime": "2025-12-10T23:17:49.460374Z",
"modifyTime": "2025-12-10T23:17:49.460374Z",
"name": "test key",
"acls": [
"team-token:endpoint:ListApiKeys",
"team-token:endpoint:CheckApiKeyPropagation",
"team-token:endpoint:ListPossibleEndpointAcls"
],
"reactedApiKey": "xai-...r42q",
"ipRanges": null
}Last updated:February 13, 2026