Developer quickstart

Learn how to make your first API request

The Alting API provides a standardized way to interact with many of the major AI models available today. Our goal is to make it easier to switch between different providers and models without having to rewrite codebases or breaking functionality. In this guide, you will learn how to generate text and images.

Create and use API key

To use Alting's API in server-side JavaScript environments like Node.js, Deno, Bun, or Nitro.js, you can use the OpenAI SDK for TypeScript and JavaScript. Get started by installing the SDK using npm or your preferred package manager.

With the OpenAI SDK installed, create a file called example.mjs and add the authentication logic below.

Make your first API request

Now that the SDK is installed and authenticated, you can make your first request. Copy any of the examples below and paste it into your example.mjs file under the existing authentication code.

Execute the code with node example.mjs (or the equivalent command for your package manager). After a few seconds, you should see the output of the API request.

Next steps