Completion Introduction
Introduction
The Genstack Completion service provides a robust API for AI-powered text completion. It offers both programmatic access through a REST API and a user-friendly web interface.
Key Features
- AI text completion with configurable parameters
- Token-based usage tracking and billing
- Developer profit sharing system
- Dynamic cost estimation and balance management
- Support for multiple AI models
- Simple REST API interface
- Web-based UI for text completion
- Cross-origin resource sharing (CORS) support
- Health monitoring and status checks
Demo UI
A demonstration page is served at https://completion.genstack.app/ui
Authentication
The service requires Genstack token authentication for all completion requests.
Pricing and Billing
The service implements a sophisticated pricing model that includes:
- Separate costs for input and output tokens
- Dynamic cost estimation based on token usage
- Configurable gross margin percentages
- Developer profit sharing
- Automatic balance checking and fund reservation
- Detailed usage tracking and reporting
Token Management
The service handles token counting and cost calculation:
- Separate tracking of prompt and completion tokens
- Conservative token estimation for balance reservation
- Actual token usage reporting in responses
- Automatic cost calculation and settlement based on token counts
Completion Models
The service supports various AI models for text completion with configurable parameters:
- Model selection
- Temperature control for response variance
- Maximum output token limits
- Message-based conversation format
For more detailed information about specific endpoints and usage examples, refer to the Endpoints and Examples sections.