Powered by Tickd.ai
Grok API 404 error: model not found, fix it
A Grok API 404 error indicates that the requested resource, often a model, was not found. This can be caused by incorrect model names or an invalid base URL.
Updated Aug 16, 2026
When you encounter a Grok API 404 error with a message like 'model not found' or 'resource not found,' it means the xAI API could not locate the specific endpoint or resource you requested. The most common causes are an incorrect model identifier, an invalid API endpoint, or an outdated API version.
To resolve a Grok API 404 'not found' error, carefully verify the model name in your request and ensure your API base URL and endpoint paths are correct and match the official documentation.
How to Fix Grok API 404 Errors
-
Verify the Model Name
The most frequent cause of a 404 error when interacting with generative AI APIs is requesting a model that doesn't exist or is misspelled. Grok's model names are case-sensitive and must exactly match those provided by xAI.
- Check official documentation: Always refer to the xAI API documentation for the most current and accurate list of available model identifiers. Model names can change or be deprecated over time.
- Compare precisely: Ensure the model name in your code (e.g.,
grok-1,grok-1.5-pro) is an exact match for what's listed in the documentation. Even a minor typo will result in a 404.
-
Confirm the API Base URL and Endpoint
The xAI API has a specific base URL and endpoint structure. An incorrect base URL or a malformed endpoint path will also lead to a 404 response.
- Standard base URL: The primary base URL for the xAI API is
https://api.x.ai/v1. Double-check that your application is targeting this exact URL. - Correct endpoint paths: Ensure the specific endpoint you're calling (e.g.,
/chat/completions,/embeddings) is correctly appended to the base URL according to the API documentation. Pay attention to leading/trailing slashes. - API versioning: Confirm you are using the correct API version (e.g.,
/v1). Attempting to access an endpoint from a deprecated or non-existent API version will result in a 404.
- Standard base URL: The primary base URL for the xAI API is
-
Inspect the Full Error Response Body
While an HTTP 404 status code is informative, the error response body from the xAI API often contains more specific details about what went wrong.
- Parse the JSON: The API typically returns a JSON object with fields like
code,message, and sometimesparamortype. Look for messages explicitly stating which resource was not found. - Log the response: Implement logging in your application to capture the full HTTP status code and response body for easier debugging.
- Parse the JSON: The API typically returns a JSON object with fields like
-
Check API Console and Status Page
Sometimes, a model might be temporarily unavailable, or there could be a service issue.
- xAI Console: Log in to your xAI Console to check for any announcements regarding model availability or changes.
- Grok Status Page: Visit the official Grok Status page (or status.x.ai) to see if there are any reported outages or degraded performance for the API services or specific models. If Grok is experiencing issues, you may also find relevant information on Is Grok Down Right Now? How to Check.
-
Review Your Code for Typos
Even seasoned developers make simple typos. Carefully review the section of your code responsible for constructing the API request, paying close attention to strings representing URLs and model names. Ensure no variables are uninitialized or holding unexpected values.
Still Stuck?
If you've followed these steps and are still encountering a Grok API 404 error, consider reviewing the comprehensive xAI API documentation again. If the issue persists and appears to be server-side, you may need to contact xAI support via the xAI Console or refer to related troubleshooting for general API issues like Grok API returns 401 Unauthorized if authentication issues are also present.