Python SDK for APIA — AI-native API manifests standard
Project description
apia-py
Python SDK for APIA — the open standard for AI-native API manifests.
pip install apia
Quickstart
from apia import Registry
registry = Registry()
# Find APIs for a task
apis = registry.find("send a telegram message")
print(apis[0].name) # → Telegram Bot API
print(apis[0].category) # → social
# Get a specific manifest
manifest = registry.get("stripe")
print(manifest.service.description_for_ai)
# Convert to OpenAI tools
tools = manifest.to_openai_tools()
# Build a system prompt for an LLM
prompt = registry.build_system_prompt(apis)
Core API
Registry
from apia import Registry
r = Registry()
# Search by intent (natural language)
r.find("track DHL package") # → [Manifest, ...]
r.find("crypto price", category="finance") # → filtered
# Load a specific manifest
r.get("openai") # → Manifest
# List with filters
r.list(category="ai") # all AI APIs
r.list(geo="RU", free_only=True) # free Russian APIs
r.list(language="ru") # Russian-language APIs
# Categories overview
r.categories() # → {"ai": 25, "finance": 17, ...}
# Build LLM system prompt from multiple manifests
prompt = r.build_system_prompt(apis)
Manifest
m = r.get("stripe")
m.id # "stripe"
m.name # "Stripe"
m.category # "finance"
m.geo # ["GLOBAL"]
m.is_free # False
# Find capability by task
cap = m.find_capability("charge a customer")
cap.id # "create_payment_intent"
cap.endpoint # "POST https://api.stripe.com/v1/payment_intents"
# Export
m.to_openai_tools() # list of OpenAI function definitions
m.to_system_prompt() # formatted string for LLM system prompt
Use with LLMs
Anthropic Claude
from apia import Registry
import anthropic
r = Registry()
apis = r.find("send telegram message")
system = r.build_system_prompt(apis)
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-haiku-4-5",
max_tokens=1024,
system=system,
messages=[{"role": "user", "content": "Send 'Hello!' to chat 123456"}]
)
print(response.content[0].text)
OpenAI function calling
from apia import Registry
import openai
r = Registry()
manifest = r.get("openweathermap")
tools = manifest.to_openai_tools()
client = openai.OpenAI()
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],
tools=tools,
)
Development
git clone https://github.com/Komsomol39/apia-py
cd apia-py
pip install -e ".[dev]"
pytest
Related
- apia-standard — manifest registry (257 APIs)
- apia-js — JavaScript/TypeScript SDK
License
MIT
Project details
Release history Release notifications | RSS feed
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 apia-0.1.0.tar.gz.
File metadata
- Download URL: apia-0.1.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1987489ff5e580497c72576e8bdb36fae26a3454c2de780fadc21a8f6b364b61
|
|
| MD5 |
9c8f0d70ef4240359352ee9d91f58d01
|
|
| BLAKE2b-256 |
d1b5d81438788235d9f68eee61ace98305e68324b5e2e4cd99e7ded65020bece
|
Provenance
The following attestation bundles were made for apia-0.1.0.tar.gz:
Publisher:
publish.yml on Komsomol39/apia-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apia-0.1.0.tar.gz -
Subject digest:
1987489ff5e580497c72576e8bdb36fae26a3454c2de780fadc21a8f6b364b61 - Sigstore transparency entry: 1829464125
- Sigstore integration time:
-
Permalink:
Komsomol39/apia-py@8d6827c7723eb024dfdcb1599f9429aa4a915a95 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Komsomol39
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8d6827c7723eb024dfdcb1599f9429aa4a915a95 -
Trigger Event:
release
-
Statement type:
File details
Details for the file apia-0.1.0-py3-none-any.whl.
File metadata
- Download URL: apia-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6befedf62a6a3fa43ded51b4b51e9831f41bf829656dabdd85edb75c064eb90
|
|
| MD5 |
ac22da0c6a94787edcf514687d887e41
|
|
| BLAKE2b-256 |
46717936751418a6b62fb8623152923fff1778ea3210df597a021483aaec7e7d
|
Provenance
The following attestation bundles were made for apia-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Komsomol39/apia-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apia-0.1.0-py3-none-any.whl -
Subject digest:
a6befedf62a6a3fa43ded51b4b51e9831f41bf829656dabdd85edb75c064eb90 - Sigstore transparency entry: 1829464157
- Sigstore integration time:
-
Permalink:
Komsomol39/apia-py@8d6827c7723eb024dfdcb1599f9429aa4a915a95 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Komsomol39
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8d6827c7723eb024dfdcb1599f9429aa4a915a95 -
Trigger Event:
release
-
Statement type: