← all repositories
64bit/async-openai

A Rust OpenAI client with a feature-flag obsession

It maps nearly every OpenAI endpoint into an optional Cargo feature so you only compile what you actually call.

2k stars Rust Language Models
async-openai
Not currently ranked — collecting fresh signals.
star history

What it does

async-openai is an unofficial, fully async Rust client for the OpenAI API. It covers the whole surface area—from chat completions and image generation to administration, vector stores, and webhooks—while exposing nearly every endpoint as an opt-in Cargo feature. The library also handles retries with exponential backoff and SSE streaming out of the box.

The interesting bit

The crate treats OpenAI-compatible providers as first-class citizens, not afterthoughts. A byot feature lets you swap in your own request and response types (or just serde_json::Value) when a provider’s schema drifts from OpenAI’s, and you can override paths, headers, and query parameters per request or globally. There is even dynamic dispatch support so the same function can talk to different providers without recompilation.

Key highlights

  • Granular feature flags let you compile only the APIs you need—down to individual domains like evals, grader, or vectorstore.
  • Tower middleware integration means you can drop in tracing, retry logic, or custom interceptors via the standard tower ecosystem.
  • BYOT (bring your own types) methods shadow the regular ones with a _byot suffix, letting you bypass strict deserialization when providers return extra fields.
  • TLS is configurable behind Cargo features: default rustls, native-tls, or a vendored OpenSSL build.
  • WASM support is available, with a companion crate for dedicated WASM workflows.

Caveats

  • Several API groups—ChatKit, Assistants, and Realtime—are explicitly marked Beta in the feature flag table, so their stability is unclear.
  • TLS backend selection is rigid: you must enable exactly one TLS feature and manually disable defaults when switching away from rustls.
  • The byot generic methods carry the same trait bounds as their typed counterparts, so they are not a free-for-all escape hatch.

Verdict

Worth a look if you are building Rust services that need to talk to OpenAI or Azure OpenAI and want compile-time control over API surface and dependencies. Skip it if you just need a quick Python script or if you are allergic to reading Cargo feature tables.

Frequently asked

What is 64bit/async-openai?
It maps nearly every OpenAI endpoint into an optional Cargo feature so you only compile what you actually call.
Is async-openai open source?
Yes — 64bit/async-openai is open source, released under the MIT license.
What language is async-openai written in?
64bit/async-openai is primarily written in Rust.
How popular is async-openai?
64bit/async-openai has 2k stars on GitHub.
Where can I find async-openai?
64bit/async-openai is on GitHub at https://github.com/64bit/async-openai.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.