Move an OpenAI-compatible app to Lexelane
What changes, what to test, and why native protocols matter.
Set the base URL and key on the server
Use https://lexelane.com/v1 as your SDK base URL and read LEXELANE_API_KEY from a private server environment variable. Do not ship a secret in browser JavaScript or mobile app source.
Use the exact available model ID
The authenticated GET /v1/models endpoint lists activated models. A brand or a similarly named alias is not necessarily a valid ID. Start with a small request and an explicit output limit.
Test streaming and tools
A basic chat response is only the first check. Exercise streamed text, tool arguments, tool results, completion markers, and final usage. Save the request ID when troubleshooting an interrupted call.
Use the right native protocol
Chat Completions, Responses, and Messages are distinct interfaces. Codex needs Responses; Claude Code needs native Messages capabilities. Choose a model whose listed protocol matches your client.