@axemere/gateway
v0.1.10
Published
Axemere AI Gateway SDK — core client, config, and proxy URL builder
Readme
@axemere/gateway
Framework-independent TypeScript client for the Axemere AI Gateway.
Use this package when you want explicit control over every request, or when you are not using OpenAI or Anthropic SDKs directly. If you are already using one of those SDKs, install the matching wrapper instead (@axemere/gateway-openai, @axemere/gateway-anthropic) — it requires no code changes beyond the import.
Install
npm install @axemere/gatewayUsage
import { AiGatewayClient, AiGatewayConfig } from "@axemere/gateway";
const config = new AiGatewayConfig(); // reads AXEMERE_GATEWAY_URL + AXEMERE_GATEWAY_TOKEN
const client = new AiGatewayClient(config);
const result = await client.execute({
provider: "openai",
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello" }],
});
console.log(result.content);
console.log(result.metering?.cost_usd); // "0.000042"Configuration
| Env var | Description |
|---------|-------------|
| AXEMERE_GATEWAY_URL | Gateway base URL, e.g. http://localhost:7080 |
| AXEMERE_GATEWAY_TOKEN | Gateway token issued by the gateway |
| AXEMERE_WORKLOAD_ID | Workload identifier for attribution |
| AXEMERE_PROJECT_ID | Project identifier for spend grouping |
Links
License
MIT
