80trust / 100

Llm Llama

by llama-api in AI models & inference

x402 APIPassing, checked 3 h ago

Llama API - pay per call, no API key. OpenAI-format chat completions on meta-llama/llama-4-maverick, pinned to DeepInfra for reliability. You sign a fixed price computed from your max_tokens; unused tokens are not refunded. 20s server-side timeout - never charged if it fires; set your client timeout to 30s. Try GET /llm/llama/sample.

POST https://x402.agentindex.world/llm/llama

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
288 ms typical, 426 ms slowest 5%
Last check
3 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://x402.agentindex.world/llm/llama" \
  -H "content-type: application/json" \
  -d '{"max_tokens":150,"messages":[{"content":"Summarize in one sentence: The Eiffel Tower is a wrought-iron lattice tower on the Champ de Mars in Paris, France. It was designed by Gustave Eiffel's engineering company and built as the entrance arch for the 1889 World's Fair. Initially criticized by some of France's leading artists and intellectuals for its design, it has become a global cultural icon of France and one of the most recognizable structures in the world, attracting millions of visitors every year.","role":"user"}]}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fx402.agentindex.world%2Fllm%2Fllama
const res = await pay("https://x402.agentindex.world/llm/llama", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"max_tokens":150,"messages":[{"content":"Summarize in one sentence: The Eiffel Tower is a wrought-iron lattice tower on the Champ de Mars in Paris, France. It was designed by Gustave Eiffel's engineering company and built as the entrance arch for the 1889 World's Fair. Initially criticized by some of France's leading artists and intellectuals for its design, it has become a global cultural icon of France and one of the most recognizable structures in the world, attracting millions of visitors every year.","role":"user"}]}),
});
console.log(await res.json());

Example input

{
  "max_tokens": 150,
  "messages": [
    {
      "content": "Summarize in one sentence: The Eiffel Tower is a wrought-iron lattice tower on the Champ de Mars in Paris, France. It was designed by Gustave Eiffel's engineering company and built as the entrance arch for the 1889 World's Fair. Initially criticized by some of France's leading artists and intellectuals for its design, it has become a global cultural icon of France and one of the most recognizable structures in the world, attracting millions of visitors every year.",
      "role": "user"
    }
  ]
}

Example output

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "The Eiffel Tower, a wrought-iron lattice tower in Paris, France, was designed by Gustave Eiffel's company for the 1889 World's Fair and has since become a global cultural icon of France, attracting millions of visitors annually.",
        "role": "assistant"
      }
    }
  ],
  "created": 1790781075,
  "id": "gen-1790781075-Lyd15GuBV6xAvA6HlOvf",
  "model": "meta-llama/llama-4-maverick",
  "object": "chat.completion",
  "provider": "DigitalOcean",
  "usage": {
    "completion_tokens": 51,
    "cost": 0.000062,
    "prompt_tokens": 106,
    "total_tokens": 157
  },
  "x402_receipt": {
    "latency_ms": 1700,
    "model_served": "meta-llama/llama-4-maverick",
    "price_paid_usdc": 0.001,
    "upstream": "llm/llama"
  }
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402288 ms$0.001
6 h agoPassed402285 ms$0.001
10 h agoPassed402426 ms$0.001
14 h agoPassed402379 ms$0.001
17 h agoPassed402352 ms$0.001
21 h agoPassed402715 ms$0.001
25 h agoPassed40275 ms$0.001
28 h agoPassed402146 ms$0.001
33 h agoPassed402238 ms$0.001