Skip to main content

llm-async-codex

ChatGPT Codex subscription provider for llm-async.

from llm_async_codex import CodexProvider

provider = CodexProvider.from_codex_home()
response = await provider.acomplete(
    model="gpt-5.5",
    messages=[{"role": "user", "content": "Review this repository."}],
    stream=True,
)
async for chunk in response.stream_content():
    print(chunk, end="", flush=True)

This reads an existing Codex CLI login from $CODEX_HOME/auth.json or ~/.codex/auth.json by default (CodexProvider.from_codex_home()), or a CodexCredentials loaded from any path via load_credentials(path).

Login

If you don't already have a Codex CLI login, log in directly:

llm-async-codex login
llm-async-codex login --device-code   # headless/SSH, no local browser needed
llm-async-codex login --auth-file ~/.my-tool/auth.json
llm-async-codex login --verbose

or from Python: await login(device_code=False, auth_path=None, verbose=False).

Tool calling

Tool calling works through the normal streaming API: call provider.acomplete(..., stream=True, tools=[...]), drain response.stream_content(), then read response.main_response.tool_calls. Requires llm-async>=0.5.2.

Limitations

  • Streaming only: the Codex backend requires stream=True; non-streaming requests are rejected.
  • No stateless multi-turn: the backend rejects store=True ("Store must be set to false"), so previous_response_id-based continuation (as used in some of llm-async's other Responses API examples) does not work here. Resend the full conversation history (including function_call/function_call_output items) on every turn instead.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_async_codex-0.1.1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_async_codex-0.1.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file llm_async_codex-0.1.1.tar.gz.

File metadata

  • Download URL: llm_async_codex-0.1.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for llm_async_codex-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fbaa0e208d738280ee316c7a01fd28f3b8425c12a20e5138056cdc7d8397b3bf
MD5 bd8949628d9ea865d97e79cd66f5e8b9
BLAKE2b-256 3e7de7421433a7550d008a21a14ce02d2844a74c982625fb61f758ec98164fec

See more details on using hashes here.

File details

Details for the file llm_async_codex-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_async_codex-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b8f460abb92c195990285ba3c8e7115e50ef13505252b8901c61ab0f23383700
MD5 a5aac8a7123e963fb6972a50735a52bd
BLAKE2b-256 e348b5fdcbbdb9c46887f015ae750f907a0dc29115ba01cf78b0fea5c5eea627

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page