T

Telnyx · T Gemma 2B

by Telnyx

POSTBase

$0.002

per call · USD Coin on Base

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

Endpoint

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

1

Calls / 30d

1

Unique payers / 30d

Aug 18

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("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"
  }),
});
const data = await res.json();
cURL
curl -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"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "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
  }
}

Payment details

Pay to0x19a78b27a28ed93c3c914878bde7f2f843afaea8
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of AI & Inference and the homepage with a featured placement.

Get featured →

More from Telnyx & similar services