Arbitr Python
Official Python client and arbitr CLI for the Arbitr External API.
pip install arbitr-sdk
The PyPI package is arbitr-sdk. The import and CLI stay arbitr.
from arbitr import ArbitrClient
client = ArbitrClient.from_env() # ARBITR_API_KEY, optional ARBITR_BASE_URL
project = client.projects.submit(
files=["report.docx"],
name="Q3 report",
target_language_codes=["ko-kr", "fr-fr"],
idempotency_key="run-2026-08-report",
)
final = client.projects.wait(project.id)
client.projects.download_zip(final.id, "out/deliverables.zip")
Async:
from arbitr import AsyncArbitrClient
async with AsyncArbitrClient.from_env() as client:
me = await client.me()
Coding agents: give your agent this prompt:
Set up arbitr for me. Fetch https://arbitr.apidocumentation.com/getting-started/agent-setup/index.md and follow it.
Or install the persistent agent skill:
npx -y skills add strakergroup/arbitr-python --skill arbitr --yes --global
CLI:
Mint a key at https://arbitr.straker.ai/settings/api-keys.
export ARBITR_API_KEY=abr_live_...
arbitr me
arbitr submit report.docx --locales ko-kr,fr-fr --wait --out out/
Exit codes: 0 ok, 1 API error, 2 usage/config/network/timeout, 3 parked
at a human gate.
Default host is production: https://api-arbitr.straker.ai.
Language codes are lowercase BCP-47 tags (ko-kr, fr-fr). Bare codes (ko)
are rejected by the API — client.languages.resolve(["ko"]) expands them, or
arbitr submit --resolve-locales does it for you.
The client wraps the published OpenAPI surface only. Deprecated aliases
(agent-selection, /deliverables/zip, /resume) are not wrapped; use the
canonical replacements (wait() / the Arbitr UI, ?format=zip, /resumptions).
Errors
Everything this package raises derives from ArbitrBaseError, so one except
is enough to be safe. Below it there are two branches:
| Branch | Raised when | Notable members |
|---|---|---|
ArbitrError |
the API returned a non-2xx response | AuthenticationError, PaymentRequiredError, NotFoundError, ConflictError, ValidationError, RateLimitError, GoneError, ServerError |
ArbitrClientError |
the call failed before or instead of an error envelope | TransportError (ConnectionFailedError, RequestTimeoutError), ClientInputError, ActionRequiredError, ProjectWaitTimeoutError, ResponseParseError |
httpx exceptions never escape the client — connection and timeout failures
arrive as ConnectionFailedError / RequestTimeoutError with the original
exception on __cause__.
from arbitr import ArbitrBaseError, PaymentRequiredError
try:
client.projects.resume(project_id)
except PaymentRequiredError as exc:
print(f"short by {exc.shortfall} credits")
except ArbitrBaseError as exc:
print(f"call failed: {exc}")
Retries and rate limits
Retries are opt-in and off by default on the library client:
client = ArbitrClient.from_env(max_retries=3)
The CLI retries GET up to 3 times (--max-retries / ARBITR_MAX_RETRIES).
Only GET is replayed — Retry-After is honoured on 429 and 5xx back off
exponentially (capped at 60s). POST /v1/projects is never retried
automatically because its multipart body streams file handles; pass
idempotency_key= and retry it yourself. After any call,
client.rate_limit holds the latest X-RateLimit-* values.
Develop
uv sync
uv run pytest
uv run ruff check src tests scripts
uv run ty check
uv run python scripts/generate_models.py # after refreshing the pinned spec
uv run python scripts/check_operation_coverage.py
Pin a fresh production spec:
curl -sS https://api-arbitr.straker.ai/openapi.json -o src/arbitr/openapi.json
uv run python scripts/generate_models.py
The snapshot ships inside the package, so an installed copy can diff itself against a live host:
from arbitr import pinned_spec
print(sorted(pinned_spec()["paths"]))
Do not edit src/arbitr/generated/models.py by hand.
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 arbitr_sdk-0.2.0.tar.gz.
File metadata
- Download URL: arbitr_sdk-0.2.0.tar.gz
- Upload date:
- Size: 47.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c60d75a10c4605e87737598a5b97624de86edd6fbb6258b7a0af044a977975d
|
|
| MD5 |
dc1f78d2ba2d0cd0d99a1c4cc0df681c
|
|
| BLAKE2b-256 |
6caa89272bafee1e37749874986e15cb0a1d4eb8cfeb07cad97f98fa8f9b7653
|
File details
Details for the file arbitr_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: arbitr_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 55.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
330ddd984eccd55cfaac9da55e9e865f6c852a533f657147c56a7084cf575773
|
|
| MD5 |
09e1f899c834637080988925d61c2be6
|
|
| BLAKE2b-256 |
1bf6f74088401c56a09355605dde5752b95b58683ceeb3c95eaacff238eb9a7b
|