Make the first call
Configure the key, base URL, model and message.
Hands-on Python and Node.js tutorials for chat, structured output, streaming, tool calling and production deployment.
Start with the decision, move into implementation and finish with production checks.
Configure the key, base URL, model and message.
Render partial output and handle interrupted requests.
Validate JSON and tool arguments before use.
Protect keys, log requests and set production limits.
Create a chat completion with an OpenAI-compatible SDK.
Open guideBuild a server-side request and stream the response.
Open guideRequest and validate reliable JSON responses.
Open guideConnect model decisions to application functions.
Open guideBuild a multi-model route for a production web app.
Open guideStart with a server-side model request, stream tokens to the UI and keep provider credentials out of the browser.
No. Keep provider credentials on the server and expose only your own authenticated application route to the browser.
Use an OpenAI-compatible SDK for portability or a provider-native SDK when the workflow needs provider-specific features.