All Guides5 steps · 10 min

OpenAI GPT Setup Guide

Get started with GPT-4o, o1 reasoning, and DALL-E for powerful AI development.

o1 Reasoning

Advanced reasoning model for complex multi-step problems.

DALL-E 3

Generate high-quality images from text descriptions.

Realtime Voice

Real-time voice conversations with WebRTC support.

1

Get Your OpenAI API Key

Create an account and get your API key from OpenAI Platform.

Visit the OpenAI Platform to create your API key:

Open OpenAI Platform

You will need to add billing to use the API beyond free credits.

2

Install OpenAI SDK

Install the official OpenAI Node.js library.

npm install openai

Or with yarn:

yarn add openai
3

Configure Environment

Set up your API key in environment variables.

Add to your environment:

export OPENAI_API_KEY="sk-proj-..."

Or in your .env file:

OPENAI_API_KEY=sk-proj-...
4

Quick Start Code

Test your setup with GPT-4o.

import OpenAI from "openai";

const openai = new OpenAI();

const response = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello, GPT!" }],
});

console.log(response.choices[0].message.content);
5

Install gICM OpenAI Agents

Add GPT-optimized agents from the marketplace.

npx @gicm/cli add agent/openai-reasoning-pro --platform=openai
npx @gicm/cli add agent/openai-code-auditor --platform=openai
Browse all OpenAI agents

Model Pricing

GPT-4o

Best for most tasks, fast and capable

$5/$15 per 1M tokens

GPT-4o-mini

Cheaper, great for simple tasks

$0.15/$0.60 per 1M tokens

o1

Deep reasoning, complex problems

$15/$60 per 1M tokens

DALL-E 3

Image generation

$0.04-$0.12 per image