ogx-api
API and Provider specifications for OGX - a lightweight package with protocol definitions and provider specs.
Overview
ogx-api is a minimal dependency package that contains:
- API Protocol Definitions: Type-safe protocol definitions for OGX APIs (inference, agents, responses, etc.)
- Provider Specifications: Provider spec definitions for building custom providers
- Data Types: Shared data types and models used across the OGX ecosystem
- Type Utilities: Strong typing utilities and schema validation
What This Package Does NOT Include
- Server implementation (see
ogxpackage) - Provider implementations (see
ogxpackage) - CLI tools (see
ogxpackage) - Runtime orchestration (see
ogxpackage)
Use Cases
This package is designed for:
- Third-party Provider Developers: Build custom providers without depending on the full OGX server
- Client Library Authors: Use type definitions without server dependencies
- Documentation Generation: Generate API docs from protocol definitions
- Type Checking: Validate implementations against the official specs
Installation
pip install ogx-api
Or with uv:
uv pip install ogx-api
Dependencies
Minimal dependencies:
openai>=2.5.0- For OpenAI-compatible typesfastapi>=0.115.0,<1.0- For FastAPI route definitionspydantic>=2.11.9- For data validation and serializationjsonschema- For JSON schema utilitiesopentelemetry-sdk>=1.30.0- For telemetryopentelemetry-exporter-otlp-proto-http>=1.30.0- For OTLP export
Versioning
This package follows semantic versioning independently from the main ogx package:
- Patch versions (0.1.x): Documentation, internal improvements
- Minor versions (0.x.0): New APIs, backward-compatible changes
- Major versions (x.0.0): Breaking changes to existing APIs
The version is determined dynamically via setuptools-scm at build time.
Usage Example
from ogx_api import (
Api,
Inference,
InlineProviderSpec,
OpenAIChatCompletionRequestWithExtraBody,
)
# Use protocol definitions for type checking
class MyInferenceProvider(Inference):
async def openai_chat_completion(
self, request: OpenAIChatCompletionRequestWithExtraBody
):
# Your implementation
pass
# Define provider specifications
my_provider_spec = InlineProviderSpec(
api=Api.inference,
provider_type="inline::my-provider",
pip_packages=["my-dependencies"],
module="my_package.providers.inference",
config_class="my_package.providers.inference.MyConfig",
)
Relationship to ogx
The main ogx package depends on ogx-api and provides:
- Full server implementation
- Built-in provider implementations
- CLI tools for running and managing stacks
- Runtime provider resolution and orchestration
Contributing
See the main OGX repository for contribution guidelines.
License
MIT License - see LICENSE file for details.
Links
Metadata
Release files for ogx-api 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ogx_api-1.0.3.tar.gz | 146.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ogx_api-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 291.9 kB
Release files / ogx_api-1.0.3.tar.gz
| Download URL | ogx_api-1.0.3.tar.gz |
|---|---|
| Size | 146.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c5a135732e1dbdca133b8caf87c720645d8eebb4b4de39a48bfda2bc5f996f9
|
|
BLAKE2b-256 checksum How to use checksums |
0a150e80b51a27d334ebf3742365b1948d059c23fc3a29cc382621444aafd44a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Sep 10, 2026.
Transparency logRelease files / ogx_api-1.0.3-py3-none-any.whl
| Download URL | ogx_api-1.0.3-py3-none-any.whl |
|---|---|
| Size | 145.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08246c264807fb02cb69a25c125aed49cced9729e546d0e2f484379dbd68fe19
|
|
BLAKE2b-256 checksum How to use checksums |
f5e9869157815e66ee24bb53f12899accaeb9994951c68de7022fad8f8dacf57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Sep 10, 2026.
Transparency log