Integration guides ยท 2026-09-22

REST API or official SDK? A choice guide for AI integration

Compares when the SDK path described in the OpenAI SDK to LLMTR migration guide fits, and when a raw REST request is the more correct choice.

Diagram showing the same goal reached two ways: the official SDK's ready-made functions on one side, raw HTTP requests and manual parsing on the other.

The OpenAI SDK migration guide covers one path

The OpenAI SDK to LLMTR migration guide focuses on changing the base URL while keeping an existing OpenAI SDK integration intact. That is the right path for an app already using the SDK in a language the official SDK supports, such as Python or JavaScript. But not every integration meets that condition.

An app running in a language the official SDK doesn't support (Go, Rust, or a less common language, for example) has to either rely on a community-written SDK, whose maintenance status can be uncertain, or send HTTP requests directly.

When an SDK provides a real advantage

The official SDK provides recurring work such as parsing streaming responses, retry logic, type definitions, and error classification out of the box; this speeds up development and reduces hand-written code. When working against a frequently changing API surface, the SDK keeping up with updates also removes a separate maintenance burden.

In an environment that wants minimal dependencies, though (an edge function, or a size-constrained mobile bundle), the extra package size the SDK brings can become a disadvantage. In that case, a raw REST request is the lighter option since it only includes the HTTP call actually needed.

  • SDK advantage: streaming parsing, retries, and type definitions come ready-made.
  • REST advantage: works language-independently, carries no extra package size.
  • On a frequently changing API surface, the SDK reduces maintenance load.

What to watch for yourself with a raw REST request

Working without an SDK means parsing streaming responses line by line, correctly classifying error codes, and building retry logic yourself. These are things the SDK solves invisibly; accepting up front that you take on that responsibility when choosing the raw REST path avoids surprises later.

Frequently asked questions

Can an app that doesn't use an SDK still work with the OpenAI-compatible API?

Yes. The OpenAI-compatible endpoint is a standard HTTP request; it can be called directly from any language or tool. The SDK is only a layer that makes that request more convenient, not a requirement.

Is it safe to use a community-written SDK?

It depends on its maintenance status. An actively updated community SDK can be acceptable, but a package that hasn't been updated in a long time may not reflect a change made to the API. In that case, a raw REST request is a more predictable choice.

Related posts