Source: https://docs.apertis.ai/intro # Quick Overview ### 1. Homepage - **[Apertis](https://apertis.ai/)** Click **[Apertis](https://apertis.ai/)** to visit the official website, where you can find the currently supported **applications**, the **[model support list](https://apertis.ai/models)**, and **more information**. ### 2. Login Click on the "Login" button in the top-right corner to register and log in. Currently, **email** and **username** login methods are supported. ### 3. Keys After completing registration, your API Key information will be displayed here. **A default API Key** is provided by default. Click `Copy` to obtain your default API Key, which starts with `sk-*`. **Please keep it secure.** If you want to create additional API Keys, you can click `Add API Key`. You can customize your API Key settings, including **quota allocation**, **model usage restrictions**, **IP access restrictions**, and **expiration date**. This allows you to allocate API Keys to different users with specific quotas and usage permissions. ### 4. Credits You can add credits using credit cards or local payment methods (Visa, MasterCard, JCB, American Express, etc.), with all transactions securely processed through **Stripe**. You can revisit this section at any time to top up or **check your remaining credits**. ### 5. Logs Through the **Logs** section, you can monitor the **usage history**, **token consumption**, and **credit usage** for each API Key. --- Source: https://docs.apertis.ai/getting-started/quick-start # Quick Start Get up and running with the Apertis API in under 5 minutes. This guide walks you through making your first API call. ## Prerequisites - An Apertis account ([Create one](https://apertis.ai/register); no card is required to register) - Model access through a [Coding Plan](https://apertis.ai/subscribe) or [PAYG balance](https://apertis.ai/setting?tab=credits) - An API key from [Settings → API Keys](https://apertis.ai/setting?tab=keys) - Basic knowledge of HTTP requests or a programming language ## Step 1: Create Your Account and Choose Access 1. [Create an Apertis account](https://apertis.ai/register) or [log in](https://apertis.ai/login). 2. Choose a [Coding Plan](https://apertis.ai/subscribe) or add [PAYG balance](https://apertis.ai/setting?tab=credits) before your first API request. 3. Use the [Models page](https://apertis.ai/models) to confirm which model IDs are available for your key type. Creating an account does not require a card. A plan or PAYG balance is still required before a paid model request can succeed. ## Step 2: Create Your API Key 1. Open [**Settings → API Keys**](https://apertis.ai/setting?tab=keys). 2. Click **Create New Key**. 3. Copy your key (format: `sk-xxxxxxxx`). > **Tip: Subscription users** > > If you have an active subscription, a dedicated key (`sk-sub-...`) is already created for you. Find it in **Settings** → **API Keys** tab (click **My Plan** in the navbar). > **Warning** > > Save your API key securely. It's only shown once! ## Step 3: Make Your First Request Choose your preferred method: ### Using cURL ```bash curl https://api.apertis.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer sk-your-api-key" \ -d '{ "model": "gpt-5.5", "messages": [ {"role": "user", "content": "Hello! What can you do?"} ] }' ``` ### Using Python First, install the OpenAI SDK: ```bash pip install openai ``` Then make a request: ```python from openai import OpenAI client = OpenAI( api_key="sk-your-api-key", base_url="https://api.apertis.ai/v1" ) response = client.chat.completions.create( model="gpt-5.5", messages=[ {"role": "user", "content": "Hello! What can you do?"} ] ) print(response.choices[0].message.content) ``` ### Using Node.js First, install the OpenAI SDK: ```bash npm install openai ``` Then make a request: ```javascript import OpenAI from 'openai'; const client = new OpenAI({ apiKey: 'sk-your-api-key', baseURL: 'https://api.apertis.ai/v1' }); async function main() { const response = await client.chat.completions.create({ model: 'gpt-5.5', messages: [ { role: 'user', content: 'Hello! What can you do?' } ] }); console.log(response.choices[0].message.content); } main(); ``` ## Step 4: Verify the Response and Activity Record A successful response looks like this: ```json { "id": "chatcmpl-abc123", "object": "chat.completion", "created": 1703894400, "model": "gpt-5.5", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! I'm an AI assistant. I can help you with..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 45, "total_tokens": 57 } } ``` ### Key Fields | Field | Description | |-------|-------------| | `id` | Unique identifier for this completion | | `model` | The model used for generation | | `choices[0].message.content` | The AI's response | | `usage` | Token usage for billing | After the request succeeds, open [**Settings → Activity**](https://apertis.ai/setting?tab=activity) and confirm the matching Activity record. The integration is complete only when you have both a successful response and the matching Activity record; account creation by itself is not activation. ## Step 5: Try Different Models Apertis provides a live model catalog across multiple providers. Availability changes over time and can vary by key type, so check the [Models page](https://apertis.ai/models) or query `GET /v1/models` before pinning an ID in production. ```python # OpenAI GPT-5.5 response = client.chat.completions.create( model="gpt-5.5", messages=[{"role": "user", "content": "Explain quantum computing"}] ) # Anthropic Claude Sonnet 4.6 response = client.chat.completions.create( model="claude-sonnet-4-6", messages=[{"role": "user", "content": "Explain quantum computing"}] ) # Google Gemini Pro response = client.chat.completions.create( model="gemini-3.1-pro-preview", messages=[{"role": "user", "content": "Explain quantum computing"}] ) ``` ### Popular Models | Model | Best For | |-------|----------| | `gpt-5.5` | General purpose, balanced | | `gpt-5.4-mini` | Fast, cost-effective | | `claude-sonnet-4-6` | Long context, analysis | | `claude-opus-4-8` | Complex reasoning | | `gemini-3.1-pro-preview` | Multimodal, long context | [View all models →](/installation/models) ## Step 6: Enable Streaming For real-time responses, enable streaming: ```python response = client.chat.completions.create( model="gpt-5.5", messages=[{"role": "user", "content": "Write a short poem"}], stream=True # Enable streaming ) for chunk in response: if chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="") ``` ## Common Use Cases ### Multi-turn Conversations ```python messages = [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What's the capital of France?"}, {"role": "assistant", "content": "The capital of France is Paris."}, {"role": "user", "content": "What's the population?"} ] response = client.chat.completions.create( model="gpt-5.5", messages=messages ) ``` ### Code Generation ```python response = client.chat.completions.create( model="gpt-5.5", messages=[{ "role": "user", "content": "Write a Python function to calculate fibonacci numbers" }] ) ``` ### Image Analysis ```python response = client.chat.completions.create( model="gpt-5.5", messages=[{ "role": "user", "content": [ {"type": "text", "text": "What's in this image?"}, {"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}} ] }] ) ``` ### Text Embeddings ```python response = client.embeddings.create( model="jina-embeddings-v3", input="Hello, world!" ) embedding = response.data[0].embedding print(f"Embedding dimension: {len(embedding)}") ``` ## Environment Variables For production, use environment variables instead of hardcoding: ```bash # Set environment variable export APERTIS_API_KEY="sk-your-api-key" ``` ```python import os from openai import OpenAI client = OpenAI( api_key=os.environ.get("APERTIS_API_KEY"), base_url="https://api.apertis.ai/v1" ) ``` ## Error Handling Always handle potential errors: ```python from openai import OpenAI, APIError, RateLimitError client = OpenAI( api_key="sk-your-api-key", base_url="https://api.apertis.ai/v1" ) try: response = client.chat.completions.create( model="gpt-5.5", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content) except RateLimitError: print("Rate limited! Please wait and retry.") except APIError as e: print(f"API error: {e}") ``` ## Next Steps Now that you've made your first API call, explore more: - [API Keys](/authentication/api-keys) - Manage and secure your keys - [Models](/installation/models) - Browse all available models - [Subscription Plans](/billing/subscription-plans) - Choose the right plan - [Streaming](/api/text-generation/streaming) - Real-time response streaming - [Integrations](/installation/cline) - Use with Cursor, Cline, and more ## Quick Reference ### Base URL ``` https://api.apertis.ai/v1 ``` ### Authentication ``` Authorization: Bearer sk-your-api-key ``` ### Key Endpoints | Endpoint | Description | |----------|-------------| | `/v1/chat/completions` | Chat completions | | `/v1/embeddings` | Text embeddings | | `/v1/images/generations` | Image generation | | `/v1/audio/speech` | Text to speech | | `/v1/audio/transcriptions` | Speech to text | | `/v1/models` | List available models | ## Getting Help - [Troubleshooting Guide](/help/troubleshooting) - [Error Codes Reference](/help/error-codes) - [Contact Support](mailto:hi@apertis.ai) --- Source: https://docs.apertis.ai/installation/models # Models Access models from OpenAI, Google, Anthropic, Meta, Microsoft, Mistral, Alibaba, NVIDIA, xAI, Amazon, DeepSeek, Perplexity, Allen AI, and other providers through [**Apertis**](https://apertis.ai). We aim to provide users with a unified API gateway to access all mainstream models while offering a more affordable, faster, and more stable service. Explore the current catalog, with prices and context windows, on the [**Models page**](/models), or browse it on [apertis.ai](https://apertis.ai/models). Your API key type determines which models are available. --- Source: https://docs.apertis.ai/principles # Why Choose Apertis? ## 🚀 Perfect Balance of Performance and Cost - **Smart Price Optimization**: Find the most competitive prices across multiple providers - **Ultimate Performance**: Ensure minimal latency and maximum throughput - **Flexible Priority Settings**: Freedom to balance these factors according to your needs ## 💡 Seamless Integration Experience - **OpenAI Compatible API**: Switch between models or providers without code modifications - **User Autonomy**: Enable end-users to choose and pay for their preferred models ## 🔍 Leading Market Insights - **Early Model Access**: Be the first to experience the latest AI models - **Real-time Usage Analytics**: Track actual application data across different models and scenarios ## 💳 Simplified Billing System - **Unified Billing Management**: Simple and transparent billing regardless of provider count - **Clear Cost Control**: Easily track and manage your AI expenditure ## 🛡️ Enterprise-Grade Reliability - **Smart Failover**: Automatic switching ensures service continuity during provider outages - **Advanced Routing**: Intelligent request distribution for consistent processing ## ⚡ Enhanced Usage Limits - **Optimized Processing Capacity**: Direct provider partnerships for higher request limits - **Increased Throughput**: Ensure your applications can handle larger workloads --- Source: https://docs.apertis.ai/usage # Models Intro Leading large language model providers on the market include **[OpenAI](https://openai.com/)**, **[Anthropic](https://www.anthropic.com/)**, **[Google](https://gemini.google.com/)**, **[Meta](https://www.llama.com/)**, **[Microsoft](https://www.microsoft.com/en-us/ai/microsoft-365-copilot)**, **[Mistral](https://mistral.ai/)**, and **[Alibaba](https://www.alibabacloud.com/)**. Each offers AI solutions with unique strengths tailored to various application needs. ### Recommended Models - **Knowledge Queries, Content Generation, Daily Assistance**: **OpenAI GPT-5.5**, Model ID: `gpt-5.5`. - **Programming and Development**: **Anthropic Claude Sonnet 4.6**, Model IDs: `claude-sonnet-4-6`, `claude-haiku-4-5`. - **Translation (Web Content, Subtitles, Research Papers)**: **Google Gemini 3.5 Flash**, Model IDs: `gemini-3.5-flash`, `gpt-5.4-mini`. ### Model Naming Rules Models are typically named with the following structure: - **Model Name**: Corresponds to the developer or provider, such as `GPT*` (**OpenAI**), `Claude` (**Anthropic**), `Gemini` (**Google**), `Llama*` (**Meta**), etc. - **Version Number**: Larger version numbers indicate significant improvements in capabilities, such as enhanced reasoning abilities. For instance, a higher version like `gpt-5.5` is more capable than an earlier release such as `gpt-5.4`. - **Sub-Version**: Sub-versions exhibit minor performance differences compared to main versions. Naming conventions vary, e.g., `gpt-5.4-mini`, `gpt-5.4-nano`. For **Gemini**, terms like **mini, flash** denote fewer parameters and lower costs. Context lengths like **32k, 128k, 4096** indicate the maximum token length the model supports. ### **OpenAI** - **Use Cases**: OpenAI models are widely used in **chatbots, content generation, and personal assistants**. - **Recommended Models**: `gpt-5.5`, `gpt-5.4-mini`, `gpt-5.4-nano`. ### **Anthropic** - **Use Cases**: **Claude** excels as a **programming assistant**, leveraging Retrieval Augmented Generation (RAG) to understand codebases and provide solutions. Paired with tools like Cursor for RAG analysis, it can efficiently analyze entire codebases, solve issues, and improve development workflows. - **Recommended Models**: `claude-opus-4-8`, `claude-sonnet-4-6`, `claude-fable-5`. ### **Google** - **Use Cases**: Gemini models offer general-purpose capabilities with competitive pricing. They are ideal for **translating web content and processing large PDFs** (e.g., research papers, patents). - **Recommended Models**: `gemini-3.5-flash`, `gemini-3.1-pro-preview`. --- Source: https://docs.apertis.ai/authentication/organizations # Organizations, Members, Projects, Groups, and Roles Organizations let you manage shared API usage, billing, members, projects, API keys, and access control from one dashboard. ## Personal and Team Organizations Every account has a default **Personal organization**. You can use it as your default workspace for personal API usage and access management. Personal organizations have a permanent owner: - The owner cannot leave or remove themselves from the Personal organization. - The owner can invite and remove other members. - Removing a member disables the member's organization-scoped API keys and admin keys for that organization. Team organizations are separate shared workspaces. By default, each user can create up to **5 team organizations**. ## Members Members are users who have joined an organization. Owners can: - Invite members by email. - Edit a member's organization role. - Remove members other than themselves from the organization. - Assign additional access through custom roles and groups. Readers can view organization resources but cannot manage billing, members, groups, roles, projects, or keys unless an owner assigns additional custom permissions. ## Invitations Invitations are pending membership requests. An invitation becomes a member only after the recipient accepts it. Invitation flow: 1. An owner sends one or more invitations by email. 2. If the recipient already has an Apertis account, they sign in and accept the invitation. 3. If the recipient does not have an account, they create one from the invite flow, then join the organization. 4. The new member appears in the Members tab after accepting. Pending invitations can be revoked individually or in bulk. Revoking a pending invitation does not affect existing members. Default limits: | Limit | Default | | ----------------------------------------- | ------- | | Personal organization members | 50 | | Personal organization pending invitations | 50 | | Team organization pending invitations | 50 | | Team organizations per user | 5 | Limits may be adjusted for enterprise customers. ## Projects Projects are usage and resource scopes inside an organization. Use them to separate environments, products, customers, or internal teams while keeping billing under the same organization. Every organization has a default project. The default project cannot be archived or removed. Owners and members with project management permission can create additional projects. Owners can: - Create projects for shared workloads. - Set an optional monthly project cap. - Open **Manage project** to manage project API keys, project people, and service accounts. - Archive non-default projects. Project rules: - Project members must already be organization members. - Adding someone to a project does not invite them to the organization. - Project-scoped API keys bill to the organization and can be limited to that project. - Service accounts belong to a project and are intended for server-side automation. - Archiving a project disables API keys scoped to that project. - Monthly project caps are an extra spending gate. They do not change which organization balance or payment method is billed. Large organization project lists are loaded with server-side pagination and search. Search by project name, slug, public project ID, or region to avoid loading every project into the browser. ## Groups Groups collect organization members so you can assign access to multiple people at once. Groups only contain users who are already organization members. Adding someone to a group does not invite them to the organization; invite and accept the member first, then add them to groups. Owners can: - Create a group with a name and description. - Add or remove joined organization members through multi-select. - Enable or disable a group. - Delete a group. Disabling a group pauses that group's role assignments. Members remain in the organization, and group membership is preserved. Deleting a group removes the group and its group role assignments; it does not remove members from the organization. ## Roles Roles define reusable permission bundles. They are assigned to members or groups. System roles provide baseline access: | Role | Purpose | | ------ | --------------------------------------------------------------------------------------- | | Owner | Full organization administration, including members, billing, projects, roles, and keys | | Reader | Read-only organization access | Custom roles let owners grant more specific capabilities, such as billing management, project management, member management, API key management, or admin key management. Role behavior: - Custom roles can be assigned directly to one member. - Custom roles can be assigned to a group, and every enabled group member inherits the role. - Effective access is additive: direct member roles plus enabled group roles. - Editing a custom role changes access for all assigned members and groups immediately. - Deleting a custom role removes that role from assigned targets immediately. ## Projects vs. Groups vs. Roles These controls solve different problems and are designed to be used together. | Control | What it is | Use it for | | ------------ | ----------------------------------------------- | ------------------------------------------------------------------- | | **Projects** | API usage, key, people, and service scopes | Separating production, staging, customers, products, or workloads | | **Groups** | Collections of organization members | Assigning the same access to multiple people | | **Roles** | Reusable permission bundles | Defining what a member or group can do | | **Keys** | Credentials used by apps, services, and people | Authenticating API requests or organization administration requests | Effective access is additive: - Organization role gives baseline access. - Direct custom roles add capabilities to one member. - Enabled group role assignments add capabilities to every member in that group. - Project membership limits access to project-scoped resources. - API key permission mode limits what that key can do, even if the creator has broader dashboard access. ## Recommended Access Flow Use this sequence for predictable organization access: 1. Invite users to the organization. 2. Wait for users to accept and appear as members. 3. Create projects for workloads or environments. 4. Add joined members to the projects they need. 5. Create groups for teams, functions, or environments. 6. Add members to groups. 7. Create custom roles when the default Owner and Reader roles are too broad. 8. Assign roles to members or groups. 9. Create project keys or service accounts for shared services. 10. Review API keys, admin keys, usage, and audit logs after access changes. ## API Keys and Member Removal Organization API keys are tied to an organization and, when applicable, to a project and owner. When a member is removed from an organization: - Their organization-scoped API keys are disabled. - Their organization admin keys are revoked. - Requests using those disabled keys are rejected. - The organization audit log records the access change. This keeps billing and access aligned with current organization membership. --- Source: https://docs.apertis.ai/authentication/api-keys # API Keys API keys are used to authenticate requests to the Apertis API. This guide explains how to obtain, manage, and secure your API keys. ## Obtaining Your API Key ### Standard API Key (PAYG) 1. **Sign up or log in** to your account at [Apertis](https://apertis.ai/login) 2. Navigate to [**API Keys**](https://apertis.ai/setting?tab=keys) 3. Click **Create New Key** to generate a new API key 4. Copy and securely store your API key - it will only be shown once ### Subscription API Key If you have an active subscription, a dedicated API key is automatically created for you: 1. Click **My Plan** in the navbar (or go to [**Settings**](https://apertis.ai/setting?tab=keys)) 2. Switch to the **API Keys** tab 3. Your subscription key (`sk-sub-...`) is listed with integration guides and ready to use > **Warning: Important** > > Your API key is displayed only once upon creation. Store it securely immediately. If you lose your key, you'll need to create a new one. ## API Key Format Apertis API keys follow this format: ``` sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` - **Prefix**: `sk-` (standard key) or `sk-sub-` (subscription key) - **Length**: 32+ characters after the prefix - **Characters**: Alphanumeric (a-z, A-Z, 0-9) ## Using Your API Key ### Authentication Methods Apertis supports two authentication methods: | Method | Header | Example | | ------------ | --------------- | --------------------------------------- | | Bearer Token | `Authorization` | `Authorization: Bearer sk-your-api-key` | | API Key | `x-api-key` | `x-api-key: sk-your-api-key` | Both methods work across all endpoints. The `x-api-key` header provides compatibility with Anthropic SDKs. ### Example: Bearer Token (OpenAI SDKs) ```bash curl https://api.apertis.ai/v1/chat/completions \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.5", "messages": [{"role": "user", "content": "Hello!"}] }' ``` ### Example: x-api-key (Anthropic SDKs) ```bash curl https://api.apertis.ai/v1/messages \ -H "x-api-key: sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello!"}] }' ``` > **Tip** > > When both headers are provided, `Authorization` takes precedence over `x-api-key`. ### Python Example ```python from openai import OpenAI client = OpenAI( api_key="sk-your-api-key", base_url="https://api.apertis.ai/v1" ) response = client.chat.completions.create( model="gpt-5.5", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content) ``` ### Node.js Example ```javascript import OpenAI from "openai"; const client = new OpenAI({ apiKey: "sk-your-api-key", baseURL: "https://api.apertis.ai/v1", }); const response = await client.chat.completions.create({ model: "gpt-5.5", messages: [{ role: "user", content: "Hello!" }], }); console.log(response.choices[0].message.content); ``` ## API Key Settings ### Quota Management Each API key has its own quota allocation: | Setting | Description | | ------------------- | ------------------------------- | | **Remaining Quota** | Available balance for API calls | | **Used Quota** | Total amount consumed | | **Unlimited** | Option to set unlimited quota | ### Model Restrictions You can restrict which models an API key can access: - **All Models**: Access to all available models (default) - **Specific Models**: Whitelist only certain models Example: Restrict a key to only use `gpt-5.5` and `claude-sonnet-4-6`: ``` Model Whitelist: gpt-5.5, claude-sonnet-4-6 ``` ### IP Whitelisting (Subnet Restrictions) For enhanced security, you can restrict API key usage to specific IP addresses or subnets: ``` Allowed IPs: 192.168.1.0/24, 10.0.0.1 ``` This ensures your API key can only be used from authorized networks. ### Expiration Date Set an expiration date for temporary or project-specific keys: - **Never Expire**: Key remains valid indefinitely - **Custom Date**: Key expires on a specific date ## Types of API Keys ### Standard API Keys (`sk-`) - Created manually by users - Configurable quota and restrictions - Suitable for development and production use ### Subscription API Keys (`sk-sub-`) - Automatically generated for subscription plans - Quota synced with subscription cycle - Automatically reset when billing cycle renews ### Organization API Keys (`sk-org_`) - Created from an organization, usually scoped to a project - Bill to the organization instead of only the individual user - Can use permission modes such as **All**, **Restricted**, or **Read only** - Are disabled when their owning member is removed from the organization ### Organization Admin Keys (`sk-admin_`) - Created from an organization by an owner or member with admin-key permission - Used for organization administration automation, not normal model inference traffic - Can manage supported organization resources through Admin API workflows - Can be limited with **All**, **Restricted**, or **Read only** permission modes - Should be stored only in trusted server-side infrastructure Organization keys have two views: | View | Use | | -------------------- | -------------------------------------------------------------- | | **Project API Keys** | Keys scoped to organization projects and shared team workloads | | **User API Keys** | Keys tied to individual members for organization usage | ### Organization API Keys Tab Rules The organization **API Keys** tab separates shared project keys from member-owned user keys so billing, audit logs, and access control stay clear. #### Project keys Project keys are owned by the organization project, not by an individual member. Use project keys for shared workloads such as production backends, staging services, CI jobs, server-side integrations, or applications maintained by a team. Project key behavior: - Owners and members with API key management permission can create project keys. - Project keys bill to the organization. - Project keys can be restricted to a project and permission mode, such as **All**, **Restricted**, or **Read only**. - The **Created by** column records who created the key, but the key remains project-owned. - Disabling or deleting a project key immediately stops requests that use it. - Project keys are the preferred choice for long-running services because they do not depend on one member's personal key lifecycle. - Project keys can be reviewed from the organization API Keys tab or from **Manage project** on the project row. Use a project key when: - A service is shared by multiple people. - The key is deployed to backend infrastructure. - Usage should continue even if the original creator changes teams. - You need organization-level billing and audit visibility. #### Project service accounts Service accounts are project-owned identities for automation. Use a service account when a backend service, worker, CI job, or integration should own the credential instead of a human member. Service account behavior: - A service account belongs to one project. - Its keys bill to the organization and are scoped to that project. - Deleting the service account disables keys owned by it. - The audit trail identifies the service account instead of a personal user key. #### User keys User keys are owned by individual organization members. Use user keys for personal development, CLI usage, local testing, notebooks, or workflows where the audit trail should point directly to one member. User key behavior: - A user key must be created by the member who owns it. - Organization owners cannot create user-owned secrets on behalf of another member. - The key's effective access follows the member's organization, project, group, and role permissions. - If the member is removed from the organization, the member's organization-scoped user keys are disabled for that organization. - Requests made with a user key are attributed to that user in audit and usage review. Use a user key when: - One person is experimenting or developing locally. - The key should stop working when that person's access is removed. - You need user-level attribution instead of a shared service identity. > **Tip** > > If an owner needs a key for a shared service, create a **Project API Key**. If a member needs a personal development key, that member should create a **User API Key** from their own account context. ### Organization Admin Keys Tab Rules Admin keys are for organization administration automation, such as managing projects, project members, service accounts, project API keys, audit-log access, or other supported Admin API operations. Admin key behavior: - Admin keys use the `sk-admin_` prefix. - The plaintext secret is shown only once. - Read-only admin keys can inspect supported admin resources but cannot write changes. - Restricted admin keys should grant only the scopes the automation needs. - Revoking an admin key immediately rejects future requests using it. - If the creating member is removed from the organization, admin access tied to that membership is revoked. Use an admin key when: - A trusted backend needs to automate organization administration. - You need CI or internal tooling to manage projects, service accounts, or project API keys. - A human owner should not paste their personal session or user key into automation. Do not use admin keys in browsers, mobile apps, customer devices, or model inference clients. For organization access rules, see [Organizations, Members, Projects, Groups, and Roles](/authentication/organizations). ## Best Practices ### Security Guidelines 1. **Never expose your API key in client-side code** ```javascript // DON'T do this in frontend code const apiKey = "sk-your-api-key"; // Exposed to users! ``` 2. **Use environment variables** ```bash export APERTIS_API_KEY="sk-your-api-key" ``` ```python import os api_key = os.environ.get("APERTIS_API_KEY") ``` 3. **Rotate keys regularly** - Create new keys periodically and deprecate old ones 4. **Use separate keys for different environments** - Development key with limited quota - Production key with appropriate restrictions 5. **Enable IP whitelisting** for production keys when possible ### Quota Management Tips - Monitor your usage regularly in the dashboard - Set up alerts for low quota warnings - Use model restrictions to prevent unexpected costs - Consider using subscription plans for predictable budgeting ## Managing Multiple Keys You can create multiple API keys for different purposes: | Use Case | Recommended Settings | | ----------------------- | ------------------------------------------- | | Development | Low quota, all models, no IP restriction | | Production | Higher quota, specific models, IP whitelist | | Testing | Limited quota, expiration date set | | Third-party Integration | Minimal quota, specific models only | ## Revoking API Keys To revoke an API key: 1. Go to **API Keys** in your dashboard 2. Find the key you want to revoke 3. Click **Delete** or **Disable** > **Caution** > > Revoking a key is immediate and cannot be undone. Any applications using that key will stop working immediately. Organization API key rows also provide quick actions: | Action | Use | | -------------------- | ------------------------------------------------------ | | **Recent Activity** | Review the selected key's last known activity metadata | | **Edit** | Rename the key or change permission mode | | **Open in Chat** | Open Apertis Chat from the key row | | **Disable / Enable** | Temporarily disable or re-enable a key | | **Delete** | Revoke the key so requests using it are rejected | ## Troubleshooting ### Common Issues | Error | Cause | Solution | | ----------------------- | -------------------------------- | ------------------------------------------- | | `401 Unauthorized` | Invalid or missing API key | Check key is correct and included in header | | `403 Forbidden` | Key doesn't have access to model | Check model restrictions on your key | | `429 Too Many Requests` | Rate limit exceeded | Reduce request frequency or upgrade plan | | `402 Payment Required` | Quota exhausted | Add more quota or enable PAYG fallback | ## Related Topics - [Subscription Plans](/billing/subscription-plans) - Learn about quota and billing - [Rate Limits](/billing/rate-limits) - Understand request limits - [Error Codes](/help/error-codes) - Complete error reference --- Source: https://docs.apertis.ai/billing/subscription-plans # Subscription Plans Apertis offers flexible subscription plans designed to meet different usage needs. Choose the plan that best fits your requirements. ## Available Plans ### Plan Comparison | Feature | Lite | Pro | Max | |---------|------|-----|-----| | Monthly Quota | Basic | Standard | Premium | | Model Access | Lite + Free models | Pro + Lite + Free models | All models | | Priority Support | - | Email | Priority | | PAYG Fallback | Optional | Optional | Optional | | Billing Cycles | Monthly, Quarterly, Yearly | Monthly, Quarterly, Yearly | Monthly, Quarterly, Yearly | ### Billing Cycles All plans are available with three billing cycle options: | Cycle | Discount | Best For | |-------|----------|----------| | **Monthly** | Standard price | Flexibility, testing | | **Quarterly** | ~10% savings | Regular usage | | **Yearly** | ~20% savings | Long-term commitment | ## Quota System ### How Quota Works Each subscription includes a monthly quota that resets at the start of each billing cycle: ``` Cycle Start → Use Quota → Cycle End → Quota Reset ↓ ↓ Full Quota New Cycle Begins ``` ### How Billing Works Every API request consumes a **fixed amount of quota** based on the model's **multiplier rate** — regardless of how many tokens you use: ``` Quota Consumed per Request = Model Rate (fixed multiplier) ``` Each request deducts the model's rate from your monthly allowance — whether the response is 10 tokens or 10,000 tokens. Higher-tier plans offer lower rates, giving you more usage per quota. > **Tip** > > This is different from PAYG (Pay-As-You-Go), which charges per token. Subscription billing is simpler: one request = one fixed quota deduction. ### Free Models Every plan includes a selection of models that consume **no quota** — typically fast, lightweight models suited to high-volume or everyday tasks. Because this lineup changes over time, we don't list specific models here. See the [Subscribe page](https://apertis.ai/subscribe) for the models currently available free on your plan. ### Model Rates by Plan Each model has a different rate depending on your plan. Higher-tier plans offer lower rates, giving you more usage per quota. For the full model list and up-to-date rates, see the [Subscribe page](https://apertis.ai/subscribe). You can also query the current rates programmatically using the [Models API](/api/utilities/models) with your subscription key — the response includes a `multiplier` field for each model. > **Tip: Coding Tools** > > When using coding tools such as Claude Code, Roo Code, Cline, Kilo Code, OpenCode, Crush, or Goose, add the `code:` prefix to Claude model IDs (e.g., `code:claude-opus-4-8`). This routes requests through optimized coding channels. The same subscription quota and rates apply. See the [Claude Code guide](/installation/claude-code#coding-model-ids) for details. ### Estimated Uses per Month You can estimate how many requests you get per month by dividing your plan's quota by the model rate: ``` Estimated Uses = Monthly Quota ÷ Model Rate ``` > **Note** > > In practice, most users mix models — using cheaper models for simple tasks and premium models for complex ones. ## PAYG (Pay-As-You-Go) Fallback ### What is PAYG Fallback? When your subscription quota is exhausted, PAYG fallback allows you to continue using the API by charging to your account balance: ``` Subscription Quota Exhausted → PAYG Kicks In → Continue Using API ``` ### Configuring PAYG | Setting | Description | |---------|-------------| | **Enable/Disable** | Toggle PAYG fallback on or off | | **Spending Limit** | Maximum PAYG spending per cycle | | **Current Spent** | PAYG amount used this cycle | ### PAYG Spending Limits Set a spending limit to control costs: ``` Example: Spending Limit = $50/month If subscription quota runs out: - PAYG activates - Maximum $50 additional spending allowed - After $50, requests will be rejected until next cycle ``` ## Subscription Lifecycle ### Subscription Status | Status | Description | |--------|-------------| | **Active** | Subscription is current and usable | | **Suspended** | Temporarily paused (payment issue or manual) | | **Cancelled** | Will end at period end | | **Expired** | Subscription has ended | ### Cycle Reset At the start of each billing cycle: 1. Quota is reset to your plan's limit 2. PAYG spending counter resets to zero 3. Usage history is preserved for reporting ### Payment Failure Handling If a payment fails: 1. **Grace Period**: 3-7 days to resolve payment issue 2. **Suspension**: Subscription suspended if not resolved 3. **Recovery**: Automatic reactivation upon successful payment ## Managing Your Subscription ### Viewing Subscription Status Access your subscription details via **Settings** → **Subscription** tab ([direct link](https://apertis.ai/setting?tab=subscription)): - Current plan and billing cycle - Quota usage (used / limit) - Next billing date - Payment history > **Tip** > > After subscribing, the navbar **Subscribe** button changes to **My Plan** — click it to jump directly to your subscription settings. You can also find **My Plan** in the user dropdown menu. ### Changing Plans You can upgrade or downgrade your plan at any time: **Upgrading:** - Takes effect immediately - Quota is prorated for the remaining period - Additional quota added instantly **Downgrading:** - Takes effect at next billing cycle - Current quota remains until cycle ends ### Cancelling Subscription To cancel your subscription: 1. Go to **Settings** → **Subscription** tab (or click **My Plan** in the navbar) 2. Click **Cancel Subscription** 3. Choose cancellation timing: - **Immediate**: Ends now (no refund for remaining period) - **End of Period**: Continues until current cycle ends > **Note** > > After cancellation, your subscription API key will stop working at the end of the billing period. ## Subscription vs. PAYG-Only ### When to Use Subscription - **Predictable usage**: You know your monthly needs - **Cost savings**: Subscriptions offer better rates than pure PAYG - **Budget planning**: Fixed monthly costs - **Consistent access**: No need to top up balance ### When to Use PAYG-Only - **Variable usage**: Usage fluctuates significantly - **Testing phase**: Evaluating the platform - **Low volume**: Occasional API calls - **No commitment**: Flexibility over savings ### Auto Top-up Enable automatic balance top-up to ensure uninterrupted service: | Setting | Description | |---------|-------------| | **Enable** | Turn on auto top-up | | **Threshold** | Balance level that triggers top-up | | **Amount** | Amount to add when triggered | | **Payment Method** | Card to charge | ``` Example: Threshold: $10 Amount: $50 When balance drops below $10 → Automatically charge $50 to your card ``` ## Dedicated Subscription Token Each subscription comes with a dedicated API token: - **Format**: `sk-sub-xxxxxxxxxxxx` - **Auto-sync**: Quota automatically synced with subscription - **Cycle Reset**: Token quota resets with billing cycle - **Separate from Regular Tokens**: Managed independently ### Finding Your Subscription Token After subscribing, find your dedicated API key in **Settings** → **API Keys** tab ([direct link](https://apertis.ai/setting?tab=keys)): 1. Click **My Plan** in the navbar (or go to **Settings**) 2. Switch to the **API Keys** tab 3. Your subscription key (`sk-sub-...`) is listed with integration guides ### Using Your Subscription Token ```python from openai import OpenAI client = OpenAI( api_key="sk-sub-your-subscription-key", base_url="https://api.apertis.ai/v1" ) # Quota is tracked against your subscription response = client.chat.completions.create( model="claude-sonnet-4-6", messages=[{"role": "user", "content": "Hello!"}] ) ``` ### Viewing Available Models Use your subscription token to query which models are available in your plan: ```python # List all models in your plan models = client.models.list() for model in models: print(model.id) ``` The `/v1/models` endpoint returns only models included in your current plan, along with extra fields like `multiplier` (quota cost) and `tier` (model origin). See [Models API](/api/utilities/models) for details. ## FAQ ### What happens when my quota runs out? - **With PAYG enabled**: API continues working, charged to your balance - **Without PAYG**: API returns `402 Payment Required` error ### Can I change my billing cycle? Yes, you can switch between monthly, quarterly, and yearly at renewal time. ### Is there a free trial? Contact support for trial options and promotional offers. ### Can I get a refund? Refunds are handled on a case-by-case basis. Contact support for assistance. ## Related Topics - [API Keys](/authentication/api-keys) - Manage your API keys - [Rate Limits](/billing/rate-limits) - Understand request limits - [Troubleshooting](/help/troubleshooting) - Common issues and solutions --- Source: https://docs.apertis.ai/billing/quota-management # Quota Management Understanding how quota works is essential for managing your API usage and costs effectively. This guide explains the quota system in detail. ## Quota Overview Quota represents your available API usage credits. Every API request consumes quota based on token usage and model pricing. ``` Request → Token Count → Model Multiplier → Quota Consumed ``` ## Types of Quota ### 1. API Key Quota Each API key has its own quota allocation: | Setting | Description | |---------|-------------| | **Remaining Quota** | Available credits for this key | | **Used Quota** | Total consumed by this key | | **Unlimited** | No quota limit (uses account balance) | ### 2. Subscription Quota Subscription plans include monthly quota that resets each billing cycle: | Component | Description | |-----------|-------------| | **Cycle Limit** | Total quota for current cycle | | **Cycle Used** | Quota consumed this cycle | | **Reset Date** | When quota resets to full | ### 3. Account Balance Your account balance for Pay-As-You-Go (PAYG) usage: | Component | Description | |-----------|-------------| | **Balance** | Current available funds | | **Used** | Total spent on PAYG | ## Quota Calculation ### Subscription Quota — Per-Request Billing Subscription plans use a **per-request** billing model. Each API request consumes a fixed amount of quota based on the model's multiplier rate: ``` Quota Consumed per Request = Model Rate (fixed multiplier) ``` This is independent of token usage — a short response and a long response cost the same quota for the same model. Different plans offer different rates for the same model — higher-tier plans have lower multipliers, giving you more requests per quota. ### PAYG — Per-Token Billing PAYG (Pay-As-You-Go) uses a **per-token** billing model. Each request is charged based on actual token consumption: ``` Cost = (Input Tokens × Input Rate) + (Output Tokens × Output Rate) ``` ### Model Pricing For current model rates and pricing, visit the [Subscribe page](https://apertis.ai/subscribe). ## Monitoring Quota Usage ### Dashboard Overview View your quota status in the dashboard: 1. **Account Overview** - Total balance and usage 2. **API Keys** - Per-key quota status 3. **Subscription** - Cycle quota remaining 4. **Usage History** - Detailed consumption logs ### API Endpoints Check quota programmatically: ```python import requests response = requests.get( "https://api.apertis.ai/v1/dashboard/billing/credits", headers={"Authorization": "Bearer sk-your-api-key"} ) credits = response.json() payg = credits["payg"] if payg["token_is_unlimited"]: print("Token quota: unlimited") else: print(f"Remaining token credits: ${payg['token_remaining']:.2f}") print(f"Used token credits: ${payg['token_used']:.2f}") if credits["is_subscriber"]: subscription = credits["subscription"] print(f"Cycle quota remaining: {subscription['cycle_quota_remaining']}") ``` ### Response Headers API responses include usage information: ```json { "usage": { "prompt_tokens": 50, "completion_tokens": 100, "total_tokens": 150 } } ``` ## Managing Quota Effectively ### 1. Choose the Right Model Match model capabilities to your needs: | Task | Recommended Model | Cost Level | |------|-------------------|------------| | Simple Q&A | GPT-5.4 nano | $ | | Code generation | GPT-5.5 | $$ | | Complex reasoning | Claude Opus 4.8 | $$$ | | Long documents | Claude Sonnet 4.6 | $$ | ### 2. Optimize Prompts Reduce token usage with efficient prompts: ```python # Inefficient (high token usage) prompt = """ I would like you to please help me with the following task. I need you to summarize the following text for me. Please make sure the summary is comprehensive and detailed. Here is the text: {long_text} """ # Efficient (lower token usage) prompt = f"Summarize:\n{long_text}" ``` ### 3. Use System Messages Wisely System messages persist across turns. Keep them concise: ```python # Good - concise system message messages = [ {"role": "system", "content": "You are a helpful coding assistant."}, {"role": "user", "content": "..."} ] # Avoid - overly detailed system message messages = [ {"role": "system", "content": "You are an extremely helpful assistant..."}, # 500+ tokens {"role": "user", "content": "..."} ] ``` ### 4. Implement Caching Cache responses for identical queries: ```python import hashlib from functools import lru_cache @lru_cache(maxsize=1000) def get_cached_response(prompt_hash, model): return client.chat.completions.create( model=model, messages=[{"role": "user", "content": prompt}] ) # Create hash for caching prompt_hash = hashlib.md5(prompt.encode()).hexdigest() response = get_cached_response(prompt_hash, "gpt-5.5") ``` ### 5. Set Quota Limits Configure API key quota limits to prevent overspending: 1. Go to **API Keys** in dashboard 2. Edit the key 3. Set **Quota Limit** 4. Save changes ## Quota Alerts ### Setting Up Alerts Configure alerts to be notified when quota is low: 1. Navigate to **Settings** → **Notifications** 2. Enable **Low Quota Warning** 3. Set threshold percentage (e.g., 20%) 4. Choose notification method (email) ### Alert Thresholds | Level | Threshold | Action | |-------|-----------|--------| | Warning | 20% remaining | Consider top-up | | Critical | 10% remaining | Top-up soon | | Exhausted | 0% remaining | Requests will fail | ## Quota Exhaustion ### What Happens When quota is exhausted: 1. **API Key Quota**: Requests return `402 Payment Required` 2. **Subscription Quota**: Falls back to PAYG per-token billing (if enabled), otherwise returns `402` 3. **Account Balance**: All requests fail with `402` ### Error Response ```json { "error": { "message": "You have exceeded your quota", "type": "billing_error", "code": "quota_exceeded" } } ``` ### Recovery Options | Situation | Solution | |-----------|----------| | API key exhausted | Increase key quota or create new key | | Subscription exhausted | Enable PAYG fallback | | Balance exhausted | Add funds to account | ## Quota Reset ### Subscription Quota Reset Subscription quota resets automatically at the start of each billing cycle: ``` Cycle Start (e.g., Jan 1) → Full Quota Available ↓ Use Throughout Month ↓ Cycle End (e.g., Jan 31) → Unused Quota Expires ↓ Next Cycle (Feb 1) → Full Quota Restored ``` > **Note** > > Unused quota does not roll over to the next cycle. ### Manual Quota Reset (Admin) Account administrators can reset quota for: - Individual API keys - Subscription cycles - User accounts ## Best Practices ### For Development 1. **Use separate keys** for development and production 2. **Set low limits** on development keys 3. **Monitor usage** during testing 4. **Use cheaper models** for development ### For Production 1. **Set appropriate limits** based on expected usage 2. **Enable auto top-up** to prevent service interruption 3. **Monitor alerts** and respond quickly 4. **Review usage regularly** for optimization opportunities ### Cost Control Strategies | Strategy | Implementation | |----------|----------------| | Model tiering | Use cheaper models for simple tasks | | Prompt optimization | Reduce token count in prompts | | Response limits | Set `max_tokens` to limit output | | Caching | Cache frequent identical queries | | Rate limiting | Implement client-side rate limits | ## Usage Reports ### Accessing Reports View detailed usage reports in the dashboard: 1. Go to **Usage** → **Reports** 2. Select date range 3. Filter by model, key, or endpoint 4. Export as CSV if needed ### Report Metrics | Metric | Description | |--------|-------------| | Total Requests | Number of API calls | | Total Tokens | Tokens consumed | | Total Cost | Quota/money spent | | Average Latency | Response time | | Error Rate | Failed requests percentage | ## Related Topics - [Subscription Plans](/billing/subscription-plans) - Plan quotas and features - [Rate Limits](/billing/rate-limits) - Request rate limits - [PAYG](/billing/payg) - Pay-As-You-Go billing - [API Keys](/authentication/api-keys) - Key management --- Source: https://docs.apertis.ai/billing/payg # Pay-As-You-Go (PAYG) Pay-As-You-Go allows you to use the Apertis API without a subscription by paying for what you use. This guide explains how PAYG works and how to manage it effectively. ## Overview PAYG is a flexible billing model where you: 1. **Add funds** to your account balance 2. **Use the API** as needed 3. **Pay per usage** based on actual consumption ``` Add Funds → Make Requests → Deduct from Balance → Top Up When Low ``` ## PAYG vs. Subscription | Feature | PAYG | Subscription | |---------|------|--------------| | Commitment | None | Monthly/Yearly | | Pricing | Standard rates | Discounted rates | | Quota Reset | Never (balance-based) | Monthly cycle | | Best For | Variable usage | Predictable usage | | Minimum | $5 | Plan price | ### When to Use PAYG - **Testing phase** - Evaluating the platform - **Sporadic usage** - Occasional API calls - **Unpredictable volume** - Usage varies significantly - **Budget flexibility** - Pay only for what you use ### When to Use Subscription - **Regular usage** - Consistent monthly volume - **Cost savings** - Lower per-token rates - **Budgeting** - Fixed monthly costs - **High volume** - Heavy API usage ## Adding Funds ### Payment Methods | Method | Availability | Processing | |--------|--------------|------------| | Credit/Debit Card | Global | Instant | All payments are securely processed through **Stripe**. ### Top-Up Process 1. Log in to [Dashboard](https://apertis.ai/login) 2. Go to **Billing** → **Add Funds** 3. Select amount 4. Choose payment method 5. Complete payment ### Minimum Top-Up | Method | Minimum | |--------|---------| | Credit Card | $5 | ## PAYG Pricing PAYG uses standard pricing per token based on the model used. For current model pricing, please visit the [Models page](https://apertis.ai/models). ### Cost Calculation ``` Cost = (Input Tokens × Input Rate) + (Output Tokens × Output Rate) ``` ## PAYG Fallback for Subscriptions Subscription users can enable PAYG as a fallback when subscription quota is exhausted. ### How It Works ``` Request → Check Subscription Quota ↓ Quota Available? → Yes → Deduct Model Rate from Quota (per-request) ↓ No PAYG Enabled? → Yes → Charge Entire Request per Token (from balance) ↓ No Return 402 Error ``` > **Note** > > When PAYG fallback activates, the **entire request** is billed using PAYG per-token pricing. There is no partial split between subscription quota and PAYG — it's one or the other. ### Enabling PAYG Fallback 1. Go to **Billing** → **Subscription** 2. Find **PAYG Fallback** section 3. Toggle **Enable PAYG Fallback** 4. Set **Spending Limit** (optional) 5. Save changes ### Spending Limits Set a maximum PAYG spending per billing cycle: | Setting | Effect | |---------|--------| | No limit | Use balance until exhausted | | $50/cycle | Max $50 PAYG per month | | $0 | PAYG disabled (same as off) | ### Billing Mode Switch Subscription and PAYG use different billing models: | Billing Mode | How It Charges | |-------------|----------------| | **Subscription** | Fixed quota per request (model rate × 1) | | **PAYG** | Per token (input tokens × input rate + output tokens × output rate) | When your subscription quota runs out and PAYG is enabled, the next request is charged entirely through PAYG per-token pricing. There is no partial split between the two billing modes. ## Auto Top-Up Automatically add funds when balance drops below a threshold. ### Configuration | Setting | Description | |---------|-------------| | **Enable** | Turn on auto top-up | | **Threshold** | Balance level to trigger | | **Amount** | Amount to add each time | | **Payment Method** | Card to charge | ### Example Setup ``` Threshold: $10 Amount: $50 When balance drops below $10: → Automatically charge $50 to saved card → New balance: current + $50 ``` ### Setting Up Auto Top-Up 1. Go to **Billing** → **Payment Methods** 2. Add or select a payment method 3. Go to **Auto Top-Up** settings 4. Enable and configure threshold/amount 5. Save ### Best Practices | Scenario | Threshold | Amount | |----------|-----------|--------| | Light usage | $5 | $20 | | Regular usage | $20 | $50 | | Heavy usage | $50 | $100 | | Production | $100 | $200 | ## Monitoring PAYG Usage ### Dashboard Views - **Balance Overview** - Current balance and recent transactions - **Usage Graph** - Daily/weekly/monthly spending trends - **Transaction History** - Detailed transaction log ### API Access Check balance programmatically: ```python import requests response = requests.get( "https://api.apertis.ai/v1/dashboard/billing/credits", headers={"Authorization": "Bearer sk-your-api-key"} ) credits = response.json() balance = credits["payg"]["account_credits"] print(f"Current balance: ${balance:.2f} USD") ``` ## Low Balance Handling ### Warning Levels | Balance | Status | Recommendation | |---------|--------|----------------| | > $20 | Normal | Continue usage | | $10-20 | Low | Consider top-up | | $5-10 | Warning | Top up soon | | < $5 | Critical | Top up immediately | ### When Balance Exhausted ```json { "error": { "message": "Insufficient account balance", "type": "billing_error", "code": "insufficient_balance" } } ``` ### Recovery Steps 1. **Immediate**: Add funds via dashboard 2. **Prevention**: Enable auto top-up 3. **Monitoring**: Set up low balance alerts ## PAYG for Teams ### Shared Balance Team accounts share a common balance: - All team members use the same balance - Usage is tracked per API key - Billing goes to account owner ### Per-Key Limits Control spending per team member: 1. Create separate API keys for each member 2. Set quota limits on each key 3. Monitor usage per key ## Cost Optimization ### Model Selection Choose cost-effective models for your use case: | Use Case | Recommended | Cost | |----------|-------------|------| | Simple chat | GPT-5.4 nano | $ | | General tasks | GPT-5.4 mini | $ | | Complex reasoning | GPT-5.5 | $$ | | Long context | Claude Sonnet 4.6 | $$ | ### Prompt Optimization Reduce costs by optimizing prompts: ```python # Expensive: Long, verbose prompt prompt = """ I would like you to help me with the following task. Please read the text below carefully and provide a detailed summary of the main points... """ # Cheaper: Concise prompt prompt = "Summarize the key points:" ``` ### Caching Strategy Implement caching for repeated queries: ```python import hashlib from functools import lru_cache @lru_cache(maxsize=1000) def cached_completion(prompt_hash): # Only calls API if not cached return client.chat.completions.create(...) ``` ### Set Max Tokens Limit response length to control costs: ```python response = client.chat.completions.create( model="gpt-5.5", messages=[...], max_tokens=500 # Limit output length ) ``` ## Billing Statements ### Viewing Statements 1. Go to **Billing** → **Statements** 2. Select month 3. View or download PDF ### Statement Contents - Beginning balance - Top-ups during period - Usage breakdown by model - Ending balance - Transaction details ## Refunds ### Refund Policy - Unused balance is generally non-refundable - Contact support for exceptional circumstances - Refunds processed to original payment method ### Requesting a Refund 1. Contact support at hi@apertis.ai 2. Provide account email and reason 3. Allow 5-7 business days for review ## FAQ ### Can I switch from PAYG to subscription? Yes, you can subscribe at any time. Your PAYG balance remains available for fallback usage. ### What happens to unused PAYG balance? Balance never expires and remains available until used. ### Can I get invoices for PAYG purchases? Yes, invoices are available in the Billing section for all top-ups. ### Is there a minimum balance required? No minimum balance is required, but we recommend maintaining at least $5 for uninterrupted service. ## Related Topics - [Subscription Plans](/billing/subscription-plans) - Compare with subscriptions - [Quota Management](/billing/quota-management) - Understanding quota - [Rate Limits](/billing/rate-limits) - Request limits - [API Keys](/authentication/api-keys) - Key management --- Source: https://docs.apertis.ai/billing/payment-methods # Payment Methods Apertis supports multiple payment methods to accommodate users worldwide. This guide explains the available options and how to manage them. ## Supported Payment Methods | Method | Availability | Currencies | Processing Time | |--------|--------------|------------|-----------------| | Credit/Debit Card | Global | USD | Instant | All payments are securely processed through **Stripe**. ## Credit & Debit Cards ### Supported Cards We accept major credit and debit cards through Stripe: - Visa - Mastercard - American Express - Discover - JCB - UnionPay ### Adding a Card 1. Go to **Billing** → **Payment Methods** 2. Click **Add Payment Method** 3. Enter card details: - Card number - Expiration date - CVC/CVV - Billing address 4. Click **Save** ### Card Security All card transactions are processed through Stripe, a PCI DSS Level 1 certified payment processor. We never store your full card number. ### Default Payment Method Set a default payment method for: - Subscription renewals - Auto top-up charges - Future purchases **To set default:** 1. Go to **Payment Methods** 2. Find the card 3. Click **Set as Default** ### Removing a Card 1. Go to **Payment Methods** 2. Find the card to remove 3. Click **Remove** > **Caution** > > You cannot remove a card if it's: > - The only payment method for an active subscription > - Set for auto top-up ### Card Declined If your card is declined: | Reason | Solution | |--------|----------| | Insufficient funds | Ensure adequate balance | | Card expired | Update with new card | | Incorrect details | Verify card information | | Bank block | Contact your bank to allow the transaction | | International block | Enable international transactions | ## Auto Top-Up ### What is Auto Top-Up? Automatically add funds when your balance drops below a threshold. Ensures uninterrupted API access. ### Setting Up Auto Top-Up 1. Go to **Billing** → **Auto Top-Up** 2. Toggle **Enable Auto Top-Up** 3. Set **Threshold** (e.g., $10) 4. Set **Top-Up Amount** (e.g., $50) 5. Select **Payment Method** 6. Save settings ### How It Works ``` Balance drops below $10 (threshold) ↓ System charges $50 to your card ↓ Balance increases by $50 ↓ Continue using API without interruption ``` ### Configuration Options | Setting | Description | Recommended | |---------|-------------|-------------| | Threshold | Balance level to trigger | $10-$50 | | Amount | Amount to add each time | $20-$100 | | Payment Method | Card to charge | Default card | ### Auto Top-Up Best Practices | Usage Level | Threshold | Amount | |-------------|-----------|--------| | Light | $5 | $20 | | Moderate | $20 | $50 | | Heavy | $50 | $100 | | Enterprise | $100+ | $500+ | ### Disabling Auto Top-Up 1. Go to **Billing** → **Auto Top-Up** 2. Toggle **Off** 3. Save changes ## Invoices & Receipts ### Accessing Invoices 1. Go to **Billing** → **Invoices** 2. Select the invoice 3. Download PDF ### Invoice Contents Each invoice includes: - Invoice number - Date - Amount and currency - Payment method - Usage summary (optional) - Tax information (if applicable) ### Tax Information To add tax ID or company information to invoices: 1. Go to **Account Settings** → **Billing Information** 2. Enter: - Company name - Tax ID / VAT number - Billing address 3. Save changes This information appears on all future invoices. ### Receipts Receipts are generated automatically for each payment: 1. Go to **Billing** → **Payment History** 2. Find the transaction 3. Click **Receipt** ## Payment Troubleshooting ### Payment Failed Common causes and solutions: | Cause | Solution | |-------|----------| | Insufficient funds | Add funds to your bank account | | Card expired | Update payment method | | Fraud protection | Contact bank to allow | | Incorrect CVV | Re-enter card details | | Billing address mismatch | Update address to match bank records | ### Duplicate Charges If you see duplicate charges: 1. Wait 24 hours (temporary holds may clear) 2. Check if both actually completed 3. Contact support with transaction details ### Refund Requests For refund requests: 1. Email hi@apertis.ai 2. Include: - Account email - Transaction date - Amount - Reason for refund Processing time: 5-10 business days ## Regional Payment Options ### Global - All major credit/debit cards (Visa, Mastercard, American Express, JCB, UnionPay) - Processed securely through Stripe ## Enterprise Payment Options For enterprise customers with specific requirements: - Wire transfer - Purchase orders - Custom billing cycles - Volume discounts Contact sales: hi@apertis.ai ## Security Best Practices ### Protecting Payment Information 1. **Use strong account password** 2. **Enable 2FA** on your account 3. **Monitor transactions** regularly 4. **Set spending limits** on API keys 5. **Review invoices** monthly ### Fraud Prevention We implement multiple fraud prevention measures: - 3D Secure for card payments - Address verification (AVS) - CVV verification - Transaction monitoring - Suspicious activity alerts ## FAQ ### Can I pay annually? Yes, subscription plans offer monthly, quarterly, and yearly billing cycles. Annual billing typically offers discounts. ### Is my payment information secure? Yes. All payments are processed by Stripe, a PCI DSS Level 1 certified payment processor. We never store full card numbers. ### Can I get a paid receipt? Yes, invoices and receipts are available in the Billing section for all transactions. ### What currency are charges in? All charges are in USD, with local currency conversion handled by your bank or payment processor. ### Why was my payment declined? Common reasons include insufficient funds, expired card, bank security blocks, or incorrect billing information. Contact your bank for specific details. ## Related Topics - [Subscription Plans](/billing/subscription-plans) - Plan options - [Quota Management](/billing/quota-management) - Managing usage - [PAYG](/billing/payg) - Pay-as-you-go billing - [FAQ](/help/faq) - Common questions --- Source: https://docs.apertis.ai/billing/rate-limits # Rate Limits Apertis implements rate limits to ensure fair usage and maintain service quality for all users. This guide explains the different rate limits and how to handle them. ## Rate Limit Overview Rate limits are applied at multiple levels to protect the service: | Level | Limit | Duration | Scope | |-------|-------|----------|-------| | **Global API** | 1,500 requests | 3 minutes | Per IP | | **API Key** | 3,000 requests | 1 minute | Per Key | | **Per-Model** | Varies by plan | 1 minute | Per Key + Per Model | | **Web Dashboard** | 120 requests | 3 minutes | Per IP | | **Critical Operations** | 20 requests | 20 minutes | Per IP | | **Log Queries** | 30 requests | 60 seconds | Per User | ## API Rate Limits ### Global API Rate Limit The primary rate limit for all API endpoints: ``` 1,500 requests per 3 minutes per IP address ``` This applies to: - `/v1/chat/completions` - `/v1/embeddings` - `/v1/images/generations` - All other `/v1/*` endpoints ### Per API Key Rate Limit Each API key has its own rate limit: ``` 3,000 requests per 1 minute per API key ``` This provides higher throughput for applications using a single API key. ### Per-Model Rate Limit Each API key is also rate-limited **per model**. This prevents a single key from overwhelming any specific model with rapid requests (e.g., automated agent loops). Model name variants are unified into a single bucket — for example, `claude-opus-4-8` and `code:claude-opus-4-8` share the same rate limit counter. The `:web` and `:free` suffixes are also normalized. | Plan | RPM per Model per Key | |------|----------------------| | **Lite** ($12/mo) | 15 | | **Pro** ($25/mo) | 20 | | **Max** ($200/mo) | 30 | | **PAYG** | 500 | > **Tip** > > Requests that are rate-limited return HTTP 429 immediately and **do not consume any quota or credits**. The request never reaches the upstream provider. ### Effective Rate Limit Your effective rate limit is the **lowest** of: - Global API limit (per IP) - API Key limit (per key) - Per-Model limit (per key + per model, based on your plan) ``` Effective Limit = min(Global Limit, API Key Limit, Per-Model Limit) ``` ## Rate Limit Headers Rate limit information is included in API response headers: | Header | Description | |--------|-------------| | `X-RateLimit-Limit` | Maximum requests allowed | | `X-RateLimit-Remaining` | Requests remaining in window | | `X-RateLimit-Reset` | Unix timestamp when limit resets | ### Example Response Headers ```http HTTP/1.1 200 OK X-RateLimit-Limit: 1500 X-RateLimit-Remaining: 1423 X-RateLimit-Reset: 1703894400 ``` ## Handling Rate Limits ### HTTP 429 Response When you exceed the rate limit, the API returns HTTP 429 with a `Retry-After` header indicating how many seconds to wait: ```http HTTP/1.1 429 Too Many Requests Retry-After: 45 ``` ```json { "error": { "message": "Rate limit exceeded for model: claude-opus-4-8. Maximum 20 requests per minute per API key. Please wait before retrying.", "type": "rate_limit_error", "code": "rate_limit_exceeded" } } ``` ### Retry Strategy Implement exponential backoff for rate limit errors: ```python import time import random from openai import OpenAI, RateLimitError client = OpenAI( api_key="sk-your-api-key", base_url="https://api.apertis.ai/v1" ) def make_request_with_retry(messages, max_retries=5): for attempt in range(max_retries): try: return client.chat.completions.create( model="gpt-5.5", messages=messages ) except RateLimitError: if attempt == max_retries - 1: raise # Exponential backoff with jitter wait_time = (2 ** attempt) + random.uniform(0, 1) print(f"Rate limited. Waiting {wait_time:.2f}s...") time.sleep(wait_time) ``` ### Node.js Example ```javascript import OpenAI from 'openai'; const client = new OpenAI({ apiKey: 'sk-your-api-key', baseURL: 'https://api.apertis.ai/v1' }); async function makeRequestWithRetry(messages, maxRetries = 5) { for (let attempt = 0; attempt < maxRetries; attempt++) { try { return await client.chat.completions.create({ model: 'gpt-5.5', messages }); } catch (error) { if (error.status !== 429 || attempt === maxRetries - 1) { throw error; } // Exponential backoff with jitter const waitTime = Math.pow(2, attempt) + Math.random(); console.log(`Rate limited. Waiting ${waitTime.toFixed(2)}s...`); await new Promise(r => setTimeout(r, waitTime * 1000)); } } } ``` ## Best Practices ### 1. Request Batching Combine multiple operations into fewer requests: ```python # Instead of multiple single-message calls for message in messages: client.chat.completions.create(messages=[message]) # Many requests # Batch into single calls when possible client.chat.completions.create(messages=messages) # Single request ``` ### 2. Implement Request Queuing Use a queue to manage request rate: ```python import asyncio from collections import deque class RateLimitedQueue: def __init__(self, max_requests_per_minute=50): self.max_rpm = max_requests_per_minute self.queue = deque() self.request_times = deque() async def add_request(self, request_func): # Wait if at rate limit while len(self.request_times) >= self.max_rpm: oldest = self.request_times[0] wait_time = 60 - (time.time() - oldest) if wait_time > 0: await asyncio.sleep(wait_time) self.request_times.popleft() # Execute request self.request_times.append(time.time()) return await request_func() ``` ### 3. Use Streaming for Long Responses Streaming doesn't reduce rate limits but improves perceived performance: ```python response = client.chat.completions.create( model="gpt-5.5", messages=[{"role": "user", "content": "Write a long story"}], stream=True ) for chunk in response: print(chunk.choices[0].delta.content, end="") ``` ### 4. Cache Responses Cache identical requests to reduce API calls: ```python import hashlib from functools import lru_cache @lru_cache(maxsize=1000) def cached_completion(messages_hash, model): # Only call API if not in cache return client.chat.completions.create( model=model, messages=messages # Original messages ) # Create hash of messages for cache key messages_hash = hashlib.md5(str(messages).encode()).hexdigest() response = cached_completion(messages_hash, "gpt-5.5") ``` ### 5. Distribute Across Multiple Keys For high-volume applications, use multiple API keys: ```python import itertools api_keys = ["sk-key1", "sk-key2", "sk-key3"] key_cycle = itertools.cycle(api_keys) def get_client(): return OpenAI( api_key=next(key_cycle), base_url="https://api.apertis.ai/v1" ) ``` ## Special Rate Limits ### Critical Operations Higher restrictions for security-sensitive operations: | Operation | Limit | Duration | |-----------|-------|----------| | Registration | 20 | 20 minutes | | Password Reset | 20 | 20 minutes | | Email Verification | 20 | 20 minutes | ### Log Query Rate Limit For log and usage queries: ``` 30 requests per 60 seconds per user ``` > **Note** > > Root users (administrators) are exempt from log query rate limits. ### Upload/Download Rate Limit For file operations: ``` 10 requests per 60 seconds per IP ``` ## Rate Limits by Plan ### Subscription Users Subscription users have per-model RPM limits that vary by plan tier. See the [Per-Model Rate Limit](#per-model-rate-limit) section above for details. Global API (1,500/3min) and API Key (3,000/min) limits remain the same across all plans. ### PAYG Users PAYG users have a generous per-model RPM limit of 500 requests per minute, since usage is billed directly. ### Enterprise Contact sales for custom rate limits for enterprise applications. ## Monitoring Your Usage ### Dashboard Metrics View your API usage in the dashboard: - Requests per minute/hour/day - Rate limit hits - Peak usage times ### Programmatic Monitoring Track rate limits in your application: ```python def check_rate_limit_headers(response): remaining = response.headers.get('X-RateLimit-Remaining') reset_time = response.headers.get('X-RateLimit-Reset') if remaining and int(remaining) < 100: print(f"Warning: Only {remaining} requests remaining") print(f"Resets at: {reset_time}") ``` ## Troubleshooting ### Consistently Hitting Rate Limits If you're frequently rate limited: 1. **Audit your request patterns** - Are you making unnecessary calls? 2. **Implement caching** - Cache repeated queries 3. **Optimize batch sizes** - Combine requests where possible 4. **Consider upgrading** - Higher plans have increased limits ### Sudden Rate Limit Errors If you suddenly start getting rate limited: 1. **Check for loops** - Infinite loops can exhaust limits quickly 2. **Review recent code changes** - New code may have introduced issues 3. **Check for concurrent users** - Multiple processes sharing same key ## Related Topics - [API Keys](/authentication/api-keys) - Manage API keys and access - [Subscription Plans](/billing/subscription-plans) - Plan limits and quotas - [Error Codes](/help/error-codes) - Understanding error responses --- Source: https://docs.apertis.ai/billing/per-key-limits # Per-Key Limits and Budget Blocks Each API key can carry its own limits. This page lists every limit you can set on a key, when Apertis checks it, and the exact response your client gets when a request is refused. It also separates the two kinds of refusal: - A **budget block** means the key or account has used up what it may spend. Waiting a few seconds does not help: wait for the reset time, or raise the limit. - A **rate limit** means too many requests or too much spend in a short window. Retrying after `Retry-After` seconds works. Every check on this page runs **before the request is sent to a model provider**. A refused request is not forwarded and is not charged. ## Limits you can set on a key You set these in the dashboard when you create or edit a key. | Limit | What it does | Resets | |-------|--------------|--------| | **Quota** (or **Unlimited**) | Total amount the key may spend over its lifetime. | Never. Add quota to the key to continue. | | **Monthly limit** | Maximum the key may spend in one monthly window. | Every month on your account's monthly reset day, at 00:00 UTC. A reset day past the end of a month uses that month's last day. | | **Hourly spend limit** | Maximum the key may spend in any trailing hour, in US dollars. | Continuously: spend older than one hour stops counting. | | **Expiration** | Date after which the key stops working. | Never. Edit the expiration or create a new key. | | **Allowed models** | The only models the key may call. Empty means all models available to you. | — | | **IP allowlist** (subnet) | The only client addresses the key may be used from. | — | Your account can also have its own **monthly spending limit**, and an organization workspace can have a **monthly spending cap**. Both are checked at the same point as a key's monthly limit and use the same error code. > **Tip: Use a monthly limit for a hard budget** > > A key's monthly limit is checked against an up-front estimate of each request's cost before the request is sent, so it is the setting to use when a key must not go past a fixed amount. The lifetime quota refuses a key once it reaches zero. ## Budget blocks | Situation | HTTP status | `error.code` | `error.message` | |-----------|-------------|--------------|-----------------| | Key's quota is used up | `401` | — | `This API Key's quota has been exhausted` | | Key's remaining quota is below the request's estimated cost, when that cost is reserved up front (see below) | `403` | `pre_consume_token_quota_failed` | `the API key's remaining quota does not cover this request` | | Key's monthly limit reached | `403` | `pre_consume_token_quota_failed` | `This API key's monthly limit is reached; it resets at