API Q&A: Why does a 405 mean you should check the request method first?
Diagnose a 405 with the method actually sent, final path, and Allow header. Distinguish a browser OPTIONS preflight from the actual API request.
Check whether the client actually sent GET, POST, or OPTIONS, then verify the final path. A 405 Method Not Allowed means the party handling the request knows the method but the target resource does not support it. A 405 response must include Allow, listing the methods the target resource currently supports. Changing models, reinstalling the SDK, or generating a new key will not make the wrong method reach the right resource. 1
Why does the URL open in my browser but my call gets a 405?
The browser address bar sends a GET. A page loading there only shows that something responds to that GET. A gateway home page, documentation page, or status page is not necessarily an endpoint that accepts generation requests. Beginners sometimes put a documentation URL in the SDK's base URL field, after which the SDK appends its own path. The reverse also happens: opening a POST endpoint in the address bar returns a 405, leading someone to conclude that the service is down.
Inspect the actual request rather than a screenshot of the configuration. Verify the hostname, complete path, and method. If there was a redirect, record the first and final requests separately and check whether the client changed methods. On your test environment or an API path you are authorized to use, try the smallest documented request. Change only one variable at a time so you know whether you fixed the path or the method.
How do I read Allow? What if it's missing?
If GET returns Allow: POST, compare that with the documentation. If this is the generation endpoint, send the documented POST with a minimal valid body. If you intended to list resources, find the correct list endpoint. Do not turn a read into a potentially billable generation request just to get rid of the error. Allow is a clue, not proof that the model provider answered: a gateway, reverse proxy, or application may have sent the response. 1
If Allow is missing, do not guess which method to try. Record the time, status, request method and path, sanitized response content type, and request identifier. If the response is an HTML page rather than the expected JSON, check whether you reached the web front door or an intermediary's error page. Share that evidence with support, not raw headers or a URL containing credentials.
Why does the command line work when the browser shows 405?
Look at separate entries in the browser's network panel. For some cross-origin requests the browser sends an OPTIONS preflight to ask whether the actual method and headers are permitted. If preflight fails, the POST might never be sent. A command-line client does not perform this browser check, so command-line success does not validate the web integration. Allow is not Access-Control-Allow-Methods; the latter is part of CORS. 2
If the request failing is OPTIONS, check whether browser access is documented and whether the page's origin, actual method, and requested headers are permitted. Do not embed long-lived API keys in the browser or disable browser security to mask the error. If the service does not support direct browser use, call your own backend from the browser and keep the provider credentials on that backend.
The shortest diagnostic sequence
- Record the HTTP method and final path of the failing request.
- Compare the endpoint documentation with
Allow. In a browser, first determine whether the failing row is the preflight.
- Retest with the documented request and verify that the response actually came from the intended API, not just a page with a success status. If it still fails, send support the sanitized evidence rather than retrying blindly.
Sources & attribution
This article references the public materials listed below. Analysis and wording are SalpX's own; quoted material remains the property of its original authors and publishers.
- 405 Method Not Allowed — MDN Web Docs · accessed 2026-12-03Note:Defines 405 and the requirement for an Allow response header.
- Cross-Origin Resource Sharing (CORS) — MDN Web Docs · accessed 2026-12-03Note:Explains the browser's OPTIONS preflight and how it differs from the actual request.
One key for Claude, GPT and 50+ models
The SalpX gateway is OpenAI-SDK compatible. Point base_url at https://www.salpx.com/v1 and you are done.