npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@apertis/ai-sdk-provider

v1.1.1

Published

Apertis AI provider for Vercel AI SDK

Downloads

498

Readme

@apertis/ai-sdk-provider

Apertis AI provider for the Vercel AI SDK.

Compatibility

  • Requires AI SDK 6.0+ - This package implements the LanguageModelV3 specification
  • Node.js 18+ - Minimum supported Node.js version

Installation

npm install @apertis/ai-sdk-provider ai

Setup

Set your API key as an environment variable:

export APERTIS_API_KEY=sk-your-api-key

Or pass it directly:

import { createApertis } from '@apertis/ai-sdk-provider';

const apertis = createApertis({ apiKey: 'sk-your-api-key' });

Usage

Basic Text Generation

import { apertis } from '@apertis/ai-sdk-provider';
import { generateText } from 'ai';

const { text } = await generateText({
  model: apertis('gpt-5.2'),
  prompt: 'Explain quantum computing in simple terms.',
});

Streaming

import { apertis } from '@apertis/ai-sdk-provider';
import { streamText } from 'ai';

const { textStream } = await streamText({
  model: apertis('claude-sonnet-4.5'),
  prompt: 'Write a haiku about programming.',
});

for await (const chunk of textStream) {
  process.stdout.write(chunk);
}

Tool Calling

import { apertis } from '@apertis/ai-sdk-provider';
import { generateText, tool } from 'ai';
import { z } from 'zod';

const { text } = await generateText({
  model: apertis('gpt-5.2'),
  tools: {
    weather: tool({
      description: 'Get weather for a location',
      parameters: z.object({ location: z.string() }),
      execute: async ({ location }) => `Sunny, 22°C in ${location}`,
    }),
  },
  prompt: 'What is the weather in Tokyo?',
});

Embeddings

Generate vector embeddings for semantic search and similarity:

import { apertis } from '@apertis/ai-sdk-provider';
import { embed, embedMany } from 'ai';

// Single embedding
const { embedding } = await embed({
  model: apertis.textEmbeddingModel('text-embedding-3-small'),
  value: 'Hello world',
});

// Multiple embeddings
const { embeddings } = await embedMany({
  model: apertis.textEmbeddingModel('text-embedding-3-large', {
    dimensions: 1024, // Optional: reduce dimensions
  }),
  values: ['Hello', 'World'],
});

Supported Models

Any model available on Apertis AI, including:

Chat Models

  • gpt-5.2, gpt-5.2-codex, gpt-5.1
  • claude-opus-4-5-20251101, claude-sonnet-4.5, claude-haiku-4.5
  • gemini-3-pro-preview, gemini-3-flash-preview, gemini-2.5-flash-preview
  • And 470+ more models

Embedding Models

  • text-embedding-3-small, text-embedding-3-large
  • text-embedding-ada-002

Provider Configuration

import { createApertis } from '@apertis/ai-sdk-provider';

const apertis = createApertis({
  apiKey: 'sk-your-api-key',     // Optional if APERTIS_API_KEY is set
  baseURL: 'https://api.apertis.ai/v1',  // Custom API endpoint
  headers: { 'X-Custom': 'value' },      // Custom headers
});

What's New (v1.1.1)

  • ProviderV3 Interface - Full implementation of ProviderV3 specification
  • Embedding Models - Support for embeddings via apertis.textEmbeddingModel()
  • Schema Fixes - More flexible response parsing for Apertis API compatibility

Breaking Changes (v1.0.0)

  • Requires AI SDK 6+ - No longer compatible with AI SDK 5.x
  • V3 Specification - Implements LanguageModelV3 interface
  • Content format - Output uses content array instead of separate text/toolCalls
  • Usage format - Token tracking uses new inputTokens/outputTokens structure
  • Supported URLs - New supportedUrls property for image URL support

License

Apache-2.0