API Documentation

Teams and Billing

When you first sign up for xAI, you will be automatically signed-up to a Personal Team. This can be viewed in your xAI Console.

All changes (billing information, API keys, etc.) performed on your xAI Console will be saved to the team displayed on the xAI Console. Ensure you are in the correct team before making any changes.

With the personal team, you can start using xAI API. However, if you want to collaborate with other team members, there are more settings that you might find helpful.


Team is the level where we track API usage, charge the billing method and issue invoice.

If you are the team creator and don't want to create a separate team, you can skip create team, optionally rename your team and add team members.

In each team, there are admin and member roles. Admin role has access to modify team name, billing information and team members, whereas Member role lacks such access. The team creator is automatically granted the Admin role.

You can create a new team by clicking on the dropdown menu, then click on "+ Create team".

Follow the on screen instructions to finish creating a new team. You can change any details entered there later as well.

Admin user can change the team name and description on the xAI Console Settings page.

You can permanently remove your team from xAI. Visit xAI Console Settings page and follow instructions under "Delete team".

Admin user can add/remove team members by email on the xAI Console Users page. Admin can designate a team member as either Admin or Member.

If you share the organization email domain with your team members, an Admin can add that domain on xAI Console Settings page under "Verified domains". Your team members signing up for xAI API service will be automatically added to the team.

You need to add a domain-verification key in your domain DNS record's TXT record to verify your domain ownership.


Ensure you are in the desired team before you change billing information. When you save the billing information or making a purchase for the first time, the billing information is save to the team you are in and shared with its members.

Any prepaid credit and payment method will be available to the team you made the purchase in.

This is the most common way to build with xAI API. Before using API, you purchase a given amount of credit. When you use the API, xAI will track your token consumption and deduct the amount from the credit available in your account.

You can add prepaid credits on the xAI Console Billing page -> "Credits".

On the same page, you can view the remaining prepaid credits, enter promo code, as well as any free credits granted by xAI team.

When you make a purchase, we automatically keep it on file to make your next purchase easier. You can also manually add payment method on xAI Console Billing page -> "Payment".

Your billing address and tax information will be displayed on the invoice. On Billing page -> "Payment", you can also add/change your billing address. When you add/change billing address, you can optionally add your organization's tax information.