Page cover

Welcome

Welcome to the ZeroCodeAi Docs! ZeroCodeAi makes it easy to run models with only a few lines of code. We offer a variety of generative AI services to help you build your products.

  • Ai models - Use the API to run various models out of the box. You only pay per token.

OpenAI compatibility

ZeroCodeAi's Api is compatible with OpenAI's client libraries, making it easy to try out our models on existing applications.

Authentication

Bearer Token Authentication is required for all endpoints. Get your token at https://zerocodeai.app/dashboard, If you don't have an account, you can register for free. New accounts come with free credits to get started.

Configuring OpenAI to use ZeroCodeAi API

To start using ZeroCodeAi with OpenAI's client libraries, pass in your ZeroCodeAi API key to the api_key option, and change the base url to https://api.zerocodeai.app/v1

Install the OpenAI SDK

npm install openai

Make your first API request

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.ZEROCODEAI_API_KEY,
  baseURL: "https://api.zerocodeai.app/v1",
});

const completion = await client.chat.completions.create({
    model: "openai/gpt-4o-mini",
    messages: [
        { role: "system", content: "You are a helpful assistant." },
        {
            role: "user",
            content: "Tell me a joke",
        },
    ],
});

console.log(completion.choices[0].message);

Last updated