Developers

Build on Animica

An OpenAI-compatible AI API with API keys, usage analytics, spend controls and signed webhooks. Point your existing OpenAI code at https://api.animica.org/v1 and you’re done.

Drop-in with the OpenAI SDK

Already using OpenAI? Change two lines.

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://api.animica.org/v1",
    api_key="anm_live_…",
)

r = client.chat.completions.create(
    model="anm-fast-8b",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(r.choices[0].message.content)

Node / TypeScript

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.animica.org/v1",
  apiKey: process.env.ANIMICA_API_KEY,
});

const r = await client.chat.completions.create({
  model: "anm-fast-8b",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(r.choices[0].message.content);

Official SDKs

TypeScript — @animica/sdk

npm i @animica/sdk

import { Animica } from "@animica/sdk";
const animica = new Animica({ apiKey: process.env.ANIMICA_API_KEY });
const r = await animica.chat.completions.create({
  model: "anm-fast-8b",
  messages: [{ role: "user", content: "Hi" }],
});

Python — animica-ai

pip install animica-ai

from animica_ai import Animica
animica = Animica(api_key="anm_live_…")
r = animica.chat_completions(
    model="anm-fast-8b",
    messages=[{"role": "user", "content": "Hi"}],
)

cURL

curl https://api.animica.org/v1/chat/completions \
  -H "Authorization: Bearer anm_live_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "model": "anm-fast-8b",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Rate limits

Per-key limits return 429 with Retry-After and standard x-ratelimit-* headers. Set a custom limit per key in the console.

Idempotency

Send an Idempotency-Key header on POSTs; retries replay the original response instead of double-charging.

Errors

Errors use the OpenAI envelope { error: { message, type, code, param } } so existing OpenAI error handling just works.

Spend controls

Per-key spend caps and org budgets (hard-stop or alert-only), plus auto-recharge — all on the Billing page.

Usage analytics

Per key / model / day usage, tokens, cost and latency — with CSV export — on the Usage page and GET /v1/usage.

Webhooks

Subscribe to request.completed, balance.low, payment.succeeded and more. Deliveries are HMAC-signed.

Verifying webhook signatures

Each delivery includes X-Animica-Signature: t=<ts>,v1=<hmac> where the HMAC is HMAC_SHA256(secret, `${t}.${rawBody}`). Reject if the timestamp is too old.

import { Animica } from "@animica/sdk";

const ok = Animica.verifyWebhook(
  endpointSecret,           // whsec_…
  rawRequestBody,           // the exact bytes you received
  req.headers["x-animica-signature"],
);

Models & playground

Browse models, pricing, and try inference live.

Workers

Bring your own compute online and earn.

Mining

One-command CLI setup for ANM, Monero, or dual.