Skip to main content

ocai-openai

The OpenAI plugin distribution for ocai. Distribution name: ocai-openai; pip install ocai[openai] resolves to the same wheel. Requires Python 3.13+ and ocai>=0.1,<0.2.

It ships only ocai/openai/ into the shared ocai PEP 420 namespace, organized one subpackage per wire interface:

  • ocai.openai.chat_completions — the /v1/chat/completions interface: typed wire structs, the codec, contract-censused conversion edges, the capability profile, and the chat component. Unary and streaming calls are implemented and certified against recorded fixtures.
  • ocai.openai.responses — the /v1/responses interface. A stub: its nodes are declared so the interface exists in the graph, but it has no edges, codec, or chat component yet. The front door never auto-selects it, and pinning interface="responses" raises LookupError until it lands.

The two are sibling interfaces of the one chat capability, not versions of each other.

What installing it does

Exactly one structural thing: the frozen ocai.openai.FRAGMENT (a CatalogFragment) becomes discoverable through the ocai.fragments entry-point group, so ocai.chat.model("openai/<model>", ...) can resolve the provider and the conversion graph gains OpenAI's nodes and edges. Importing ocai.openai is inert; there is no import-time registration. Applications that want an explicit catalog compose it themselves with Catalog.of(ocai.openai.FRAGMENT).

from ocai.openai import chat_model
from ocai.core import ApiKey

model = chat_model("gpt-4o", credentials=ApiKey.from_env("OPENAI_API_KEY"))
result = model.chat(...)   # needs ocai[http] and a real key

chat_model is sugar over ocai.chat.model("openai/<model>", ...) on a catalog built from this fragment, never a separate code path.

Boundaries

  • No openai SDK: ocai owns the wire through ocai.wire. This plugin depends on ocai.core + ocai.convert + ocai.chat only, never on ocai.wire or httpx, so archived traffic can be re-converted by tooling with no ability to make network calls.
  • msgspec is used only at the wire-decode boundary.
  • Every conversion edge declares an EdgeContract and ships golden fixtures in the repository's spec/.

License

Source-available under FSL-1.1-ALv2 (converting to Apache-2.0 two years after each release). ocai is not open source.

Metadata

Release files for ocai-openai 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocai-openai 0.1.1
File Size Uploaded Provenance Actions
ocai_openai-0.1.1.tar.gz 54.1 kB With provenance Details for ocai_openai-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ocai-openai 0.1.1
File Interpreter ABI Platform Actions
ocai_openai-0.1.1-py3-none-any.whl Python 3 none any Details for ocai_openai-0.1.1-py3-none-any.whl

Total release size: 105.2 kB

Release files / ocai_openai-0.1.1.tar.gz

Download URL ocai_openai-0.1.1.tar.gz
Size 54.1 kB
Tags Source
SHA-256 checksum
How to use checksums
be8b620da91ca0a7a5d7fbe92b19b9a484cbb431287da8133bcf923d16623dd4
BLAKE2b-256 checksum
How to use checksums
4a8f46779cacc60dc003765e9a128343cd49c798202eec477f0700cdbd265a82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / ocai_openai-0.1.1-py3-none-any.whl

Download URL ocai_openai-0.1.1-py3-none-any.whl
Size 51.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d1f404055a5cf021ad48638f6fcba78e1a950751a791ccbbd6cb22e1fbffd3e
BLAKE2b-256 checksum
How to use checksums
435d4863192726a4dcf8a90567e9d16fc9af0da6bb8995807df4b334a2aab0fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for ocai-openai 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ocai_openai-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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