(edited)
Calling Grok 4.1 models (which are only available via Google Vertex AI) returns a 404 error.
I tried both the legacy namespace xai/grok-4.1-fast-reasoning and the new namespace spacexai/grok-4.1-fast-reasoning, but both failed.
I also tested this in the AI Gateway Playground.
The logs show that all requests were routed to xai/ instead of spacexai/, regardless of what was actually specified in the model ID.
Debug details from AI Gateway Playground:
{ "name": "GatewayInternalServerError", "message": "Not Found", "statusCode": 404, "cause": { "name": "AI_APICallError", "message": "{\"error\":{\"message\":\"Not Found\",\"type\":\"AI_APICallError\",\"param\":{\"error\":\"Not Found\",\"statusCode\":404,\"name\":\"AI_APICallError\",\"message\":\"Not Found\",\"isRetryable\":false,\"type\":\"AI_APICallError\"}},\"providerMetadata\":{\"gateway\":{\"routing\":{\"originalModelId\":\"grok-4.1-fast-reasoning\",\"resolvedProvider\":\"vertex\",\"fallbacksAvailable\":[],\"canonicalSlug\":\"xai/grok-4.1-fast-reasoning\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"xai/grok-4.1-fast-reasoning\",\"success\":false,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"vertex\",\"credentialType\":\"system\",\"success\":false,\"error\":\"Not Found\",\"startTime\":1792330221227,\"endTime\":1792330221323,\"statusCode\":404}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"02039ab319f547f5fbcc7fbdb3b75819\",\"clientSessionIdSource\":\"fingerprint\"},\"generationId\":\"gen_01M57K9HHQGE66H5FJT7VXXD9X\"}}}", "statusCode": 404, "responseBody": { "error": { "message": "Not Found", "type": "AI_APICallError", "param": { "error": "Not Found", "statusCode": 404, "name": "AI_APICallError", "message": "Not Found", "isRetryable": false, "type": "AI_APICallError" } }, "providerMetadata": { "gateway": { "routing": { "originalModelId": "grok-4.1-fast-reasoning", "resolvedProvider": "vertex", "fallbacksAvailable": [], "canonicalSlug": "xai/grok-4.1-fast-reasoning", "modelAttemptCount": 1, "modelAttempts": [ { "canonicalSlug": "xai/grok-4.1-fast-reasoning", "success": false, "providerAttemptCount": 1, "providerAttempts": [ { "provider": "vertex", "credentialType": "[Redacted]", "success": false, "error": "Not Found", "startTime": 1792330221227, "endTime": 1792330221323, "statusCode": 404 } ] } ], "totalProviderAttemptCount": 1, "affinity": { "outcome": "skipped_below_min_prefix" }, "clientSessionId": "02039ab319f547f5fbcc7fbdb3b75819", "clientSessionIdSource": "fingerprint" }, "generationId": "gen_01M57K9HHQGE66H5FJT7VXXD9X" } } }, "data": { "error": { "message": "Not Found", "type": "AI_APICallError", "param": { "error": "Not Found", "statusCode": 404, "name": "AI_APICallError", "message": "Not Found", "isRetryable": false, "type": "AI_APICallError" } }, "providerMetadata": { "gateway": { "routing": { "originalModelId": "grok-4.1-fast-reasoning", "resolvedProvider": "vertex", "fallbacksAvailable": [], "canonicalSlug": "xai/grok-4.1-fast-reasoning", "modelAttemptCount": 1, "modelAttempts": [ { "canonicalSlug": "xai/grok-4.1-fast-reasoning", "success": false, "providerAttemptCount": 1, "providerAttempts": [ { "provider": "vertex", "credentialType": "[Redacted]", "success": false, "error": "Not Found", "startTime": 1792330221227, "endTime": 1792330221323, "statusCode": 404 } ] } ], "totalProviderAttemptCount": 1, "affinity": { "outcome": "skipped_below_min_prefix" }, "clientSessionId": "02039ab319f547f5fbcc7fbdb3b75819", "clientSessionIdSource": "fingerprint" }, "generationId": "gen_01M57K9HHQGE66H5FJT7VXXD9X" } } } }}