@apiverve/ai-sdk
v0.1.0
Published
APIVerve tools for the Vercel AI SDK: email and phone validation, IP, DNS and SSL lookups, exchange rates, and any of ~380 APIs by id.
Readme
@apiverve/ai-sdk
APIVerve tools for the Vercel AI SDK. Give a model email and phone validation, IP, DNS and SSL lookups and exchange rates, or let it search and call any of about 380 APIVerve APIs by id.
Install
npm install @apiverve/ai-sdk ai zodGet an API key at dashboard.apiverve.com. A free account includes monthly credits. Set it as APIVERVE_API_KEY, or pass { apiKey } to any tool.
Usage
import { generateText, isStepCount } from 'ai';
import { apiverveTools } from '@apiverve/ai-sdk';
const { text } = await generateText({
model: 'openai/gpt-5-mini',
prompt: 'Is [email protected] a deliverable address, and where is 8.8.8.8?',
tools: apiverveTools(),
stopWhen: isStepCount(5),
});
console.log(text);Pick individual tools instead of the whole set:
import { validateEmail, checkSslCertificate } from '@apiverve/ai-sdk';
const tools = {
validateEmail: validateEmail(),
checkSslCertificate: checkSslCertificate({ apiKey: process.env.MY_APIVERVE_KEY }),
};Tools
| Tool | What it does |
|---|---|
| validateEmail | Syntax, MX and SMTP checks; flags disposable, free and role addresses |
| validatePhoneNumber | Formats, country, carrier and line type |
| lookupIpAddress | Location, timezone and network of an IPv4 or IPv6 address |
| lookupDnsRecords | A, AAAA, MX, TXT, NS, CNAME and other records |
| checkSslCertificate | Issuer, validity dates and days until expiry |
| getExchangeRate | Latest or historical rate between two currencies |
| findApis | Searches the APIVerve catalog and returns API ids and parameters. Free; needs no key |
| runApi | Calls any catalog API by id, for example vindecoder, whoislookup or vatrates |
findApis and runApi together let a model reach the whole catalog: it searches for what it needs, then calls it.
Security
- Requests go only to
https://api.apiverve.com. Redirects are refused, so the key cannot be forwarded elsewhere. - The key is sent only in the
x-api-keyheader and is redacted from any returned body or error. findApisreads the public catalog athttps://assets.apiverve.com/cli-manifest.json, cached for an hour.- No runtime dependencies beyond the
aiandzodpeers.
Links
- Docs: docs.apiverve.com/integrations/vercel-ai-sdk
- API catalog: apiverve.com/marketplace
- Support: [email protected]
- Privacy: apiverve.com/privacy
License
MIT
