
Check API key propagation via the xAI Management API
Confirm an inference API key has reached every inference cluster before you flip traffic onto a freshly created or rotated secret when runbooks need a hard ready signal instead of guessing from the first chat response. Official Accounts and Authorization documents GET /auth/api-keys/{apiKeyId}/propagation on https://management-api.x.ai, authorized with a management key. The Management API guide notes a slight delay can exist between creating an API key and that key being available across all clusters, and it shows the same propagation check. The response body includes icPropagation, a map from inference cluster address to a boolean indicating whether the key has propagated. Create the management key first with Create a management key in the xAI Console if you do not already have one.
What you need
A management key that can read API key status for the team, the apiKeyId returned when the key was created or listed (not the secret string), and a deploy gate that waits until every cluster you care about reports true. Neighboring key jobs include Manage API keys with the xAI Management API, Rotate an xAI API key via the Management API, and Rotate or disable an xAI API key. More API jobs live on the API hub.
Poll propagation after create or rotate
- Export the management key and the API key id outside of source control:
export XAI_MANAGEMENT_KEY="your_management_key"
export XAI_API_KEY_ID="your_api_key_id"
- Request propagation status:
curl "https://management-api.x.ai/auth/api-keys/${XAI_API_KEY_ID}/propagation" \
-H "Authorization: Bearer ${XAI_MANAGEMENT_KEY}"
Read
icPropagation. The documented example maps cluster hosts such ascloud9.api.x.aiandus-east-1.api.x.aito booleans. Treat the key as ready for a cluster only when that entry istrue. If any required cluster is stillfalse, wait and repeat the GET before you point production clients at the new secret.After a create, keep the one-time
apiKeysecret from the create response in a password manager; propagation checks useapiKeyIdonly and never re-expose the full secret. After a rotate via Rotate an xAI API key via the Management API, poll propagation on the sameapiKeyIdbefore you delete the old secret from clients, respecting anyoldSecretExpireTimewindow you set on rotate.
Keep every call on https://management-api.x.ai. An inference API key against https://api.x.ai will not answer Management auth routes.
Gate deploys on the map
Wire the propagation GET into CI or a release checklist so a green chat smoke test is not the only signal that every region accepted the key. When a region you do not use still shows false, document whether your traffic path needs that cluster before you block the release. Pair with the list and update flows in Manage API keys with the xAI Management API when ACL or rate-limit changes accompany the new secret.
Pitfalls
Calling propagation with the secret string instead of apiKeyId fails auth or returns the wrong resource. Shipping traffic the moment create returns apiKey without waiting for icPropagation produces intermittent 401s on lagging clusters. Treating a single true entry as global readiness when another required cluster remains false leaves regional canaries red. Mixing this Management check with consumer Grok login state on grok.com invents a readiness signal that never applies to team inference keys.