provider::openai-codex::abort
Cancel the in-flight upstream stream for a request_id (router::abort fan-out), stopping billed generation immediately.
- request_idstringrequired
- abortedbooleanrequired
OpenAI Codex (ChatGPT subscription) provider; implements provider::openai-codex::stream and provider::openai-codex::refresh_models behind llm-router, with ChatGPT device-code sign-in and automatic session renewal backed by private state.
exact versions are immutable; binary and bundle artifacts are digest-pinned.
Cancel the in-flight upstream stream for a request_id (router::abort fan-out), stopping billed generation immediately.
Count prompt tokens for {model, system_prompt?, tools?, messages} locally with the tiktoken tokenizers; never runs the model and costs nothing.
Wire agent messages, the same shape `provider::openai-codex::stream` accepts. Must be non-empty.
Single-variant role tags: exact-match on deserialize, correct wire string on serialize, and they let `AgentMessage` be an untagged union.
Model id the prompt targets; selects the tokenizer (o200k_base for gpt-4o/gpt-5/o-series and anything unknown-modern, cl100k_base for gpt-3.5 and non-o gpt-4 families).
System prompt counted as its own wire message when present.
Function invocation schemas; each serialized schema counts toward the total.
Always `tiktoken`: a local tokenizer produced the estimate.
Estimated prompt tokens for the assembled request.
Internal: router::ready subscriber that re-declares this provider and refreshes its catalog.
Fetch the authenticated Codex model catalog and replace this provider's namespaced router slice; returns the active model count.
Stream an OpenAI Codex completion: resolve a ChatGPT OAuth token from the vault, call the upstream Responses API, and relay AssistantMessageEvent frames to writer_ref.
Single-variant role tags: exact-match on deserialize, correct wire string on serialize, and they let `AgentMessage` be an untagged union.