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(FunctionToolpublic API only). - Ship: Plugin (
xyberos.pluginsentry 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aff691e56fefad3285ecba0393d164c45160e4559f4ca56ce33881ec55ee9427
|
|
| MD5 |
2e7f149278498ae0b2a98c5d555ce086
|
|
| BLAKE2b-256 |
49a4bbba10120e1f13125731fb0db923df722dd2a8dc8e0cdd8cf962d6c7e799
|
Provenance
The following attestation bundles were made for xyberos_http_api-0.1.0.tar.gz:
Publisher:
pypi-plugins.yml on xyberos/xyberos-plugins
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xyberos_http_api-0.1.0.tar.gz -
Subject digest:
aff691e56fefad3285ecba0393d164c45160e4559f4ca56ce33881ec55ee9427 - Sigstore transparency entry: 2495208493
- Sigstore integration time:
-
Permalink:
xyberos/xyberos-plugins@cd98ad6193005275396bb763df8de0468830de4a -
Branch / Tag:
refs/heads/master - Owner: https://github.com/xyberos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-plugins.yml@cd98ad6193005275396bb763df8de0468830de4a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file xyberos_http_api-0.1.0-py3-none-any.whl.
File metadata
- Download URL: xyberos_http_api-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3df4fbd8129863821407121285823aeaa9b75083139b9c9828e3a8cca838cbcb
|
|
| MD5 |
bc4115e6e41fe7dee8946ca5876469a9
|
|
| BLAKE2b-256 |
714b914963581b0f160ecb8a5b2eb92c964c6adb700beb9b4575e36e96122f22
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xyberos_http_api-0.1.0-py3-none-any.whl -
Subject digest:
3df4fbd8129863821407121285823aeaa9b75083139b9c9828e3a8cca838cbcb - Sigstore transparency entry: 2495208535
- Sigstore integration time:
-
Permalink:
xyberos/xyberos-plugins@cd98ad6193005275396bb763df8de0468830de4a -
Branch / Tag:
refs/heads/master - Owner: https://github.com/xyberos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-plugins.yml@cd98ad6193005275396bb763df8de0468830de4a -
Trigger Event:
workflow_dispatch
-
Statement type: