OneApp
API ReferenceGuidesGitHub
Checking status...Status
⌘KSearch
DashboardGet API Key

Documentation

Getting StartedAuthenticationError CodesChangelog

Resources

API ReferenceSystem StatusSupport
Home
Documentation
Getting Started

Getting Started

Get up and running with the OneApp API in under 5 minutes.

1

Install the SDK

# Install the SDK
npm install @oneapp/sdk

# Or with yarn
yarn add @oneapp/sdk

# Or with pnpm
pnpm add @oneapp/sdk
2

Authenticate

Get your API key from the Dashboard and configure the client.

import { OneApp } from '@oneapp/sdk';

// Initialize the client
const oneapp = new OneApp({
  apiKey: process.env.ONEAPP_API_KEY,
});

// Get current user
const user = await oneapp.auth.getCurrentUser();
console.log('Hello,', user.name);
3

Make Your First Request

Create an AI conversation:

import { OneApp } from '@oneapp/sdk';

const oneapp = new OneApp({
  apiKey: process.env.ONEAPP_API_KEY,
});

// Create a conversation
const conversation = await oneapp.ai.conversations.create({
  title: 'My First Conversation',
  model: 'claude-3-opus',
});

console.log('Created conversation:', conversation.id);
4

Send a Message

Chat with AI:

// Send a message and get AI response
const response = await oneapp.ai.messages.create({
  conversationId: conversation.id,
  role: 'user',
  content: 'Hello! Can you help me with Python?',
});

console.log('AI Response:', response.assistantMessage.content);

You're Ready!

Explore more features:

API Reference

Explore all endpoints

Authentication

Learn about auth methods

Error Handling

Handle errors gracefully

Changelog

See what's new