Introduction to the AI API
Welcome to our AI API documentation! Our API provides powerful artificial intelligence capabilities that you can integrate into your applications with just a few lines of code. This tutorial section will guide you through everything you need to know to get started and make the most of our services.
What Our API Offers
Our AI API provides two main types of capabilities:
Text Completions
The text completion API allows you to generate text based on a prompt. This is ideal for:
- Content generation
- Creative writing assistance
- Text summarization
- Information extraction
- Custom text transformations
Chat Completions
The chat completion API enables you to build conversational experiences by maintaining context across multiple exchanges. This is perfect for:
- Chatbots and virtual assistants
- Customer service automation
- Interactive learning systems
- Guided workflows
- Multi-turn conversations
API Structure
Our API follows RESTful principles and uses JSON for request and response bodies. The main endpoints are:
/api/v1/completions/text- Generate text completions/api/v1/completions/chat- Generate chat completions/api/v1/models- List available AI models/api/v1/credits/packages- View available credit packages/api/v1/credits/checkout- Purchase API credits/api/v1/credits/history- View credit purchase history
Authentication
All API requests require authentication using API keys. You'll need to include your API key in the Authorization header of every request:
Authorization: Bearer YOUR_API_KEY
You can find your API key in your account dashboard after activating developer mode.
Credit System
Our API uses a credit-based billing system. Different operations consume different amounts of credits based on factors like:
- The type of request (text vs. chat)
- The model used
- The number of tokens processed
- Any additional features utilized
You can purchase credits through our platform and monitor your usage in your account dashboard.
Available Models
We offer several AI models with different capabilities and performance characteristics. You can specify which model to use for each request, or let our system automatically select the most appropriate one.
The available models can be retrieved using the /api/v1/models endpoint.
Getting Started
We recommend starting with the Quick Start Guide if you're new to our API, then exploring the more detailed tutorials as needed.
Support and Resources
If you encounter any issues or have questions, you can:
- Contact our support team at help@graphine.ai
We're excited to see what you'll build with our AI API!