@antseed/provider-openai
v0.2.16
Published
OpenAI-compatible provider plugin for Antseed
Downloads
1,515
Readme
@antseed/provider-openai
Provide OpenAI-compatible API capacity on the AntSeed P2P network (OpenAI, Together, OpenRouter, and similar).
Important: Simply reselling raw API access without adding value may violate your API provider's terms of service. AntSeed is designed for providers who build differentiated services on top of API access — for example, running inference inside a Trusted Execution Environment (TEE), packaging domain-specific skills or agents, fine-tuned models, or offering a managed product experience. Always review your API provider's usage policies before offering capacity on the network.
Installation
antseed plugin add @antseed/provider-openaiUsage
export OPENAI_API_KEY=sk-...
antseed seed --provider openaiConfiguration
| Key | Type | Required | Default | Description |
|-----|------|----------|---------|-------------|
| OPENAI_API_KEY | secret | Yes | -- | OpenAI-compatible upstream API key |
| OPENAI_BASE_URL | string | No | https://api.openai.com | Upstream base URL |
| OPENAI_PROVIDER_FLAVOR | string | No | generic | Special handling profile (generic, openrouter) |
| OPENAI_UPSTREAM_PROVIDER | string | No | -- | Optional OpenRouter upstream provider selector |
| OPENAI_UPSTREAM_SERVICE_PREFIX | string | No | -- | Optional prefix added to announced service names when forwarding upstream (example: together/) |
| OPENAI_SERVICE_ALIAS_MAP_JSON | string | No | -- | Optional JSON map of announcedService -> upstreamService |
| OPENAI_EXTRA_HEADERS_JSON | string | No | -- | Extra headers as JSON object |
| OPENAI_BODY_INJECT_JSON | string | No | -- | JSON object merged into request body |
| OPENAI_STRIP_HEADER_PREFIXES | string[] | No | -- | Comma-separated header prefixes to strip |
| ANTSEED_INPUT_USD_PER_MILLION | number | No | 10 | Input token price (USD per 1M) |
| ANTSEED_OUTPUT_USD_PER_MILLION | number | No | 10 | Output token price (USD per 1M) |
| ANTSEED_SERVICE_PRICING_JSON | string | No | -- | Per-service pricing as JSON |
| ANTSEED_MAX_CONCURRENCY | number | No | 10 | Max concurrent requests |
| ANTSEED_ALLOWED_SERVICES | string[] | No | -- | Comma-separated service allowlist |
Example: announce kimi2.5 on AntSeed while forwarding to Together service together/kimi2.5 upstream:
export ANTSEED_ALLOWED_SERVICES="kimi2.5"
export OPENAI_UPSTREAM_SERVICE_PREFIX="together/"Example: explicit per-service alias mapping:
export ANTSEED_ALLOWED_SERVICES="kimi2.5,deepseek-v3"
export OPENAI_SERVICE_ALIAS_MAP_JSON='{"kimi2.5":"together/kimi2.5","deepseek-v3":"openrouter/deepseek/deepseek-chat"}'When both are set, OPENAI_SERVICE_ALIAS_MAP_JSON entries take precedence over OPENAI_UPSTREAM_SERVICE_PREFIX for matching announced services.
How It Works
Uses BaseProvider and StaticTokenProvider from @antseed/provider-core to relay requests to OpenAI-compatible APIs with Authorization: Bearer authentication.
