81trust / 100

T Gemma 2b

by x402.telnyx.com in AI models & inference

x402 APIPassing, checked 3 h ago

Chat completions via Telnyx Inference (google/gemma-2b-it). OpenAI-compatible. $0.002 USDC per call.

POST https://x402.telnyx.com/v1/chat/completions/_t/gemma-2b

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
224 ms typical, 224 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.telnyx.com/v1/chat/completions/_t/gemma-2b" \
  -H "content-type: application/json" \
  -d '{"max_tokens":64,"messages":[{"content":"Say hello in one short sentence.","role":"user"}],"model":"google/gemma-2b-it"}'
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.03:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fx402.telnyx.com%2Fv1%2Fchat%2Fcompletions%2F_t%2Fgemma-2b
const res = await pay("https://x402.telnyx.com/v1/chat/completions/_t/gemma-2b", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"max_tokens":64,"messages":[{"content":"Say hello in one short sentence.","role":"user"}],"model":"google/gemma-2b-it"}),
});
console.log(await res.json());

Example input

{
  "max_tokens": 64,
  "messages": [
    {
      "content": "Say hello in one short sentence.",
      "role": "user"
    }
  ],
  "model": "google/gemma-2b-it"
}

Example output

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "Hello!",
        "role": "assistant"
      }
    }
  ],
  "id": "chatcmpl-xxx",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 4,
    "prompt_tokens": 12,
    "total_tokens": 16
  }
}

Security scan

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

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402224 ms$0.002