{user_name}
Grok AI hero banner for a WordPress guide on creating xAI API keys

Create Grok API Key: Guide for WordPress and xAI API Integration

This guide explains how you create a Grok API Key from xAI and add it to your WordPress plugin.

Short & to the point

  1. Open xAI Console and sign in: Go to the xAI Console and sign in with xAI, X/Twitter, Google or email.
  2. Check credits and team: Make sure your team has API access and that credits or billing are set up.
  3. Open API Keys: After login go to API Keys or Manage API keys.
  4. Create key: Click Create API key, give it a unique name and choose the required models or endpoints.
  5. Copy key: Copy the Grok API Key immediately after creating it. It will not be shown again in plain text.
  6. Paste the key into your WordPress software

1. Open xAI Console and sign in

Start directly at the xAI Console. If you are not signed in you will see the login first. Depending on your account you can sign in with email, Google, X/Twitter or an xAI account to sign in.

The API Key is not created in the normal X app but in the xAI developer console.

xAI Console API entry for Grok API Keys
The API entry points to the xAI Console where teams credits and API keys are managed.

Set up payment method under Billing

After login check if credits or billing are set up. Without sufficient credits a key may be visible but API requests will still fail later.

xAI Console billing dashboard showing Grok credits balance Add credits button highlighted for API key usage and top-up guidance
Use the API Keys button to switch from the product page to the developer console where Grok Keys are created.

3. Open API Keys in the xAI Console

After login open the API Keys section in the console via the left sidebar. There you see existing keys and can create new keys.

xAI Console sidebar showing highlighted ”API Keys” tab for creating and managing Grok API keys in WordPress guide
Create a new Grok API key

4. Create a new Grok API Key

In the API Keys area click Create API key. Give it a unique name for example by website client or environment.

xAI Console dialog showing ”Create API Key” with Name field filled as ”WordPress AI Plugin” and highlighted Create API key button
In Manage API keys you create name and manage the keys for your Grok integration.

5. Copy Grok API key

After creation the key is shown. Copy it immediately and treat it like a password. Once the dialog is closed the full key cannot be shown again.

Screenshot of xAI Console showing a newly created Grok API key dialog with Copy API Key button and mask icon
Copy the API key to paste it into a WordPress plugin such as neo WP AI.

6. Paste Grok API key into your WordPress plugin

Paste the Grok API key at the end into your WordPress plugin, for example neo WP AI, or store it in your own server application. It is important that the key does not end up in frontend JavaScript or in publicly visible HTML output.

For your own projects a separate key is clearer than a shared key. This way usage, permissions and rotation can later be clearly assigned to an integration.

7. Pricing, models and Batch API

Grok or xAI pricing depends on the model, token type, output format and usage. The official xAI docs list current model prices for text, coding, image, video and voice features. Example values from older articles may be out of date.

8. Observe rate limits for the Grok API

xAI currently describes rate limits per team and per model. Limits are controlled among other things via requests per second and tokens per minute. The specific limit depends on the team tier and cumulative API usage.

9. Common xAI and Grok error codes

  • 401 Unauthorized: The Authorization header is missing or the token is invalid.
  • 403 Forbidden: API key or team does not have the required permissions.
  • 404 Not Found: Resource, endpoint or model name does not exist.
  • 429 Too Many Requests: The current rate limit has been reached.
  • 500 Internal Server Error: Temporary backend error on xAI side.
★★★★★

Rate now!

[{user_coupon}]

{user_discount} Discount

Redeem now!