Skip to main content

xyberos-http-api

Generic HTTP/API connector plugin — RFC-0019, M2. "Point at any REST API, get typed tools."

A declarative spec (JSON / YAML / Python dict) describes a base_url, optional auth, optional rate limiting, and one operation per endpoint. Each operation becomes a typed Tool whose parameters are validated and coerced through FunctionTool / coerce_arguments.

This is the highest-leverage item after MCP: it is a dependency of the MCP client (M3) and web search (M5), and it unblocks the whole multiplier chain.

Install

pip install -e ./http-api

Usage

Load a plugin from a spec file:

from xyberos import create_app
from xyberos_http_api import HttpApiPlugin

app = create_app()
app.load_plugin(HttpApiPlugin("examples/weather.json"))

app.tools.execute("get_forecast", None, latitude=40.71, longitude=-74.01)

Or from a dict / YAML, or configure it entirely through the environment:

export HTTP_API_SPEC=/path/to/spec.json     # or HTTP_API_SPEC_JSON='{...}'

The module-level plugin is auto-discovered via the xyberos.plugins entry-point group; an unconfigured instance registers nothing (it logs a warning instead of breaking load_entry_points()).

Spec format

{
  "name": "github",
  "base_url": "https://api.github.com",
  "headers": { "Accept": "application/vnd.github+json" },
  "auth": { "type": "bearer", "token_env": "GITHUB_TOKEN" },
  "rate_limit": { "calls_per_second": 5, "burst": 10 },
  "operations": [
    {
      "name": "get_user",
      "method": "GET",
      "path": "/users/{username}",
      "description": "Get a GitHub user's public profile.",
      "params": [
        { "name": "username", "in": "path", "required": true },
        { "name": "per_page", "in": "query", "type": "integer", "default": 30 }
      ],
      "response_path": "some.nested[0].value"   // optional JSON extraction
    }
  ]
}

Parameters

Each param has name, in (query | path | header | body), type (string | integer | number | boolean | array | object), required, description, and an optional default. The generated tool's JSON schema mirrors these, so an LLM gets a typed signature.

Auth

type fields notes
api_key key_name, in (header/query), value/env sent per request
bearer token/token_env Authorization: Bearer <token>
basic username/username_env, password/password_env base64 basic
oauth2 token_url, client_id/client_id_env, client_secret/client_secret_env, scope client_credentials, token cached

Secrets are read from environment variables first, then literals. No secret is ever required in the spec file.

Rate limiting

rate_limit uses the core xyberos.utils.resilience.RateLimiter (token bucket) and is applied per request.

Examples

  • examples/http_api_weather.py — Open-Meteo (no key).
  • examples/http_api_github.py — GitHub REST API.

Tests

pip install pytest
pytest tests/

The tests spin up a local http.server and exercise the full stdlib client — no external network required.

Contract & ship location

  • Contract: Tool (FunctionTool public API only).
  • Ship: Plugin (xyberos.plugins entry point).
  • Dependencies: xyberos>=1.0; everything else is standard library.

Download files

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

Source Distribution

xyberos_http_api-0.1.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

xyberos_http_api-0.1.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file xyberos_http_api-0.1.0.tar.gz.

File metadata

  • Download URL: xyberos_http_api-0.1.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for xyberos_http_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aff691e56fefad3285ecba0393d164c45160e4559f4ca56ce33881ec55ee9427
MD5 2e7f149278498ae0b2a98c5d555ce086
BLAKE2b-256 49a4bbba10120e1f13125731fb0db923df722dd2a8dc8e0cdd8cf962d6c7e799

See more details on using hashes here.

Provenance

The following attestation bundles were made for xyberos_http_api-0.1.0.tar.gz:

Publisher: pypi-plugins.yml on xyberos/xyberos-plugins

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

File details

Details for the file xyberos_http_api-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xyberos_http_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3df4fbd8129863821407121285823aeaa9b75083139b9c9828e3a8cca838cbcb
MD5 bc4115e6e41fe7dee8946ca5876469a9
BLAKE2b-256 714b914963581b0f160ecb8a5b2eb92c964c6adb700beb9b4575e36e96122f22

See more details on using hashes here.

Provenance

The following attestation bundles were made for xyberos_http_api-0.1.0-py3-none-any.whl:

Publisher: pypi-plugins.yml on xyberos/xyberos-plugins

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

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