A 404 can mean the request took the wrong turn
You have an API key, a client, and a model selected. Your first request returns 404. Before replacing the key or changing models, check the address your client actually requested.
A 404 means the server could not find the requested resource. With an AI API, that can mean a missing route, an incorrect path, or an unavailable model. It does not automatically mean your account is broken.
The base URL is a useful first checkpoint because one misplaced path segment can send an otherwise valid request to the wrong destination.
Separate the host, base URL, and endpoint
Think of an API address as a building address followed by directions to a particular room. The host identifies the service. The path identifies the route inside that service.
- Host: https://api.fastapirelay.com identifies SwiftRelay’s API server.
- Base URL: the starting address configured in your client. Depending on the client, it may include a path such as /v1.
- Endpoint: the route for a particular operation, such as /chat/completions in an OpenAI-compatible chat request.
Your client combines its configured base URL with the route it needs. Problems start when the configuration and the client both supply the same segment, or when neither supplies a required segment.
Use the address your particular client expects
For SwiftRelay, Claude Code and Gemini CLI take the bare host: https://api.fastapirelay.com. Do not copy an OpenAI SDK configuration into either tool and assume the extra path belongs there.
For an OpenAI-compatible SDK, use https://api.fastapirelay.com/v1 as the base URL. The SDK then builds the operation-specific request from that base. For example, a chat completions call should reach https://api.fastapirelay.com/v1/chat/completions.
The important distinction is that /v1 belongs in the OpenAI-compatible base URL, but the complete operation endpoint usually does not. A setting named base_url is not normally asking for the final address of one particular request.
Catch duplicated and missing path segments
Read the final request URL from your client’s error details or debug output. That address is more useful than the value you remember entering.
- Duplicated version: /v1/v1/chat/completions suggests that a version segment was added twice.
- Missing version: /chat/completions without /v1 is a warning sign for the OpenAI-compatible chat route.
- Duplicated endpoint: /v1/chat/completions/chat/completions suggests that a complete endpoint was entered where the client expected a base URL.
- Wrong destination: a documentation page, dashboard address, or old provider host is not the API host.
Also check for spelling mistakes, pasted quotation marks, and trailing spaces. Trailing slash handling varies between clients, so follow the expected base URL format rather than adding slashes experimentally.
Verify the loaded setting before changing anything else
A correct configuration file does not prove the running process is using it. An environment variable, project setting, or launch script may override the address. Restart the client after updating its configuration, then inspect the next request.
Change one setting at a time. Keep the same model and test request while correcting the URL. Otherwise, a successful retry will not tell you which change fixed the problem.
If the address is correct and the 404 remains, read the response body. A message about an unknown model calls for checking model availability and the exact identifier. A missing-route message points back toward the path or API compatibility. Never publish your API key when sharing diagnostic output.
Finish the first run with one clean configuration
SwiftRelay is a practical option for using Claude Code, Codex, Gemini CLI, and OpenAI-compatible SDKs with token-based billing. Sign up for SwiftRelay to try the setup with the small gift credit available to new accounts.
Keep the working base URL recorded alongside the client name. The reusable lesson is simple: match the address to the client, then verify the final request path before blaming the key or model.