Use when an agent needs vectors for search, RAG, clustering or dedup
1gateway.dev/v1/ai/embed
Use when an agent needs vectors for search, RAG, clustering or dedup. Input: text (GET) or POST JSON {texts:[...]} with up to 32 strings of max 2000 chars each. Output: model, dims (1024), embeddings with index and vector; compare with cosine similarity. Multilingual (100+ languages, strong Korean). Not stored. Example: ?text=x402%20pay-per-call%20API
GET
https://1gateway.dev/v1/ai/embedUptime100% of 1 check in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://1gateway.dev/v1/ai/embed?text=x402+pay-per-call+API+for+AI+agents&texts=");
console.log(await res.json());Example input
{
"text": "x402 pay-per-call API for AI agents",
"texts": ""
}