Skip to main content

Typed Python client for the Coval evaluation platform API.

Project description

coval-sdk (Python)

Typed Python client for the Coval evaluation platform API. The API classes and Pydantic v2 models are generated from the same public OpenAPI specs that power the API reference. CovalClient adds authentication, safe retries, pagination, and one entry point for every public v1 resource.

Install

pip install coval-sdk

Requires Python 3.9+.

Quick start

import os

from coval_sdk import CovalClient, paginate

with CovalClient(os.environ["COVAL_API_KEY"]) as coval:
  for agent in paginate(
    coval.agents.list_agents,
    items_field="agents",
    page_size=50,
  ):
    print(agent.id, agent.display_name)

The client sends the required lowercase x-api-key header and defaults to https://api.coval.dev/v1.

Retries

GET, HEAD, and OPTIONS requests retry 408, 429, and transient 5xx responses up to three total attempts with exponential backoff. Mutating requests are not retried by default, which avoids duplicating side effects.

from coval_sdk import CovalClient

# Disable transport retries.
coval = CovalClient(api_key, retries=False)

# Use a custom base URL.
staging = CovalClient(api_key, base_url="https://staging.api.coval.dev/v1")

Generated client

All generated API classes, models, ApiClient, Configuration, and typed exceptions remain available for lower-level usage:

from coval_sdk import AgentsApi, ApiClient, Configuration

config = Configuration(host="https://api.coval.dev/v1")
with ApiClient(config) as client:
  client.set_default_header("x-api-key", api_key)
  page = AgentsApi(client).list_agents(page_size=50)

What's included

  • 25 typed API classes, including agents, conversations, runs, run templates, metrics, monitors, reports, tags, webhooks, and organization configuration
  • Pydantic v2 request and response models
  • Lowercase API-key authentication and connection pooling
  • Safe retry and token-pagination helpers

Development

From the repository root:

COVAL_SPECS_DIR=../docs/api-reference/v1 node scripts/bundle-spec.mjs
bash scripts/generate-sdks.sh
python -m pytest python-sdk/tests

License

MIT.

Project details


Download files

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

Source Distribution

coval_sdk-0.3.0.tar.gz (223.3 kB view details)

Uploaded Source

Built Distribution

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

coval_sdk-0.3.0-py3-none-any.whl (691.0 kB view details)

Uploaded Python 3

File details

Details for the file coval_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: coval_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 223.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for coval_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2b9c6b6747a14955550f61189d315007d45b650987c6fd24f4d3b67fa7950df2
MD5 d41f1a58f2a082a0d13fab64e609a910
BLAKE2b-256 cee697f46a3a97e5033cb6864c797e5c0ac8783f0dad6cf165c2a9dc1298211a

See more details on using hashes here.

Provenance

The following attestation bundles were made for coval_sdk-0.3.0.tar.gz:

Publisher: publish-coval-sdk.yml on coval-ai/coval-examples

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coval_sdk-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: coval_sdk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 691.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for coval_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42c85287d6f013e080d78e679f258d7f101a142c2d4247bcf05f4b8c0a21b0cc
MD5 d3f4079d603e906557f7e0d3d668a0c5
BLAKE2b-256 a684f07c70504fe800bba2f05a69ddb229cfdd4920f85099a81b7af9311d717b

See more details on using hashes here.

Provenance

The following attestation bundles were made for coval_sdk-0.3.0-py3-none-any.whl:

Publisher: publish-coval-sdk.yml on coval-ai/coval-examples

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page