Create API Key
To create an API key, open the PromptIDE (ide.x.ai) and sign in using your X account.
Step 1
After signing in, click on your username in the top right hand corner of the screen and then select API Keys.
Step 2
Now click on the Create API Key button, which open a dialog window that allows you to customize the API key ACLs.
By default, no ACLs are selected, which means the API key cannot be used to access any endpoint. As a best practice,
select only the ACLs that are necessary for accomplishing the task you have in mind. If you want to use the API key
to access Grok, add the chat:write
ACL. If you would only like to sample from the raw Grok-1 model, add only the
sampler:write
ACL. The respective ACLs use the :write
suffix because sampling from either Grok or Grok-1 will
count towards your token limit and is this a data-mutating operation.
Step 3
After clicking Save, the list of API keys refreshes, and you see your newly created API key. From here, you can click the pencil icon to adjust the ACLs and the bin icon to delete an API key. To start using the API key with our SDK, click the Copy button.
Step 4
Now you're ready to start playing with our API using our Python SDK.