If you already integrate with OpenAI you can usually swap the base URL, provide a Sudo API key, and you’re done. Base URL:
https://sudoapp.dev/apiCompletions endpoint:
/v1/chat/completions
Some third-party model providers do not support every OpenAI feature (for example tools or vision). Refer to their individual documentation when in doubt.
Requests
The request body youPOST to /v1/chat/completions accepts the same fields you’re used to.
Below is an example condensed TypeScript definition (non-exhaustive):
Headers
Only two headers are required:Example
curl
Responses
Sudo normalises provider responses to match the OpenAI schema. A non-streaming response looks like this:Example Response
Finish reasons
finish_reason is one of stop, length, tool_calls, content_filter, or error – mirroring OpenAI’s values.
Error handling
Errors follow the shape:Error
Next steps
Headers & Auth
Read about authenticating requests
Streaming
See Streaming to deliver tokens to your UI in real-time.