Inflection AI™ for Developers
Dashboard
Docs
API
Account
Introduction
Things to try
Pricing
Authentication
Workspaces
Prompt examples
Creativity and learning
Language use
Working with data
Technical questions

Getting started with the Inflection AI API

Inflection-3 comprises two models designed for distinct purposes:

  • Pi (3.0): the model powering our Pi experience, including a backstory, emotional intelligence, productivity, and safety. It excels in scenarios such as customer support chatbots. Set the config field in the API request JSON to inflection_3_pi to use this model.
  • Productivity (3.0): the model optimized for following instructions. It is better for tasks requiring JSON output or precise adherence to provided guidelines. Set the config field in the API request JSON to inflection_3_productivity to use this model.

Things to try

Since these models learn over time, experiment with various prompts and conversation styles. Pi will also mirror your tone and style, so if you use more emojis, so will Pi!

Pricing

Account setup and billing

To start generating API keys, all new users must provide valid credit card information and make an initial deposit of $100 to their account. This ensures a seamless onboarding experience and uninterrupted access to our services.

ModelPricing for Input TokensPricing for Output Tokens
Productivity Pi$2.50 per 1M$10 per 1M
Pi 3.0$2.50 per 1M$10 per 1M

Context Window

Both models currently support a 8k context window.

Real-time usage tracking

After each session, users can easily monitor their API usage through intuitive, real-time usage graphs. These tools provide transparency and control, allowing users to track their consumption and manage their balance effectively.

Customizable auto-reload threshold & auto-reload

For added convenience, you can set a customizable account auto-reload threshold. If your balance falls below the designated threshold, the credit card on file will be automatically charged with an auto-reload amount of your choosing. Both the threshold and the top-up amounts are fully configurable to align with your needs, providing flexibility and peace of mind.

Authentication

To access and interact with the Inflection AI API, every request must include a valid API key. This key serves as a token that authenticates your organization or personal account with the API, ensuring secure and authorized usage. Below, we’ll walk through how to obtain your API key and demonstrate the process of including it in your requests.

Obtaining your API key

To begin using the Inflection AI API, you need to obtain an API key. Follow these steps to retrieve your key:

  1. Go to 'API Keys' page: Once signed in, navigate to the "Keys" section.
  2. Create API Key: Click on 'Create API Key' and type in a key name. Key name must be at least 3 characters long.
  3. Try it out: Either try using the cUrl command provided or go to Playground page and try the key out.

API key format

Your API key is a long string that resembles the following example:

nfHB2f...IrQNMm4

This key must be included in the headers of all API requests to authenticate the client. Ensure that you replace nfHB2f...IrQNMm4 with your actual key.

Including the API key in requests

For each request to the Inflection AI API, include the Authorization header with the value Bearer <YOUR_API_KEY>.

Here’s an example using cURL to authenticate:

curl --location 'https://layercake.pubwestus3.inf7ks8.com/external/api/inference' \
    --header 'Authorization: Bearer <YOUR_API_KEY>' \
    --header 'Content-Type: application/json' \
    --data '{
        "context": [
            {
                "text": "Hi",
                "type": "Human"
            }
        ],
        "config": "inflection_3_pi"
    }'

In this example:

  • The Authorization header is used to pass your API key.
  • The Bearer prefix is mandatory and must precede your API key.
  • The Content-Type header specifies that the request is in JSON format.
  • The --data flag includes the request payload with the input context and configuration.

Key management

  • Security: It is crucial to keep your API key secure and confidential. Avoid exposing it in publicly accessible codebases or client-side applications. If you believe your key has been compromised, you can delete the compromised key and generate a new one through the developer portal.

Handling authentication errors

In the event of an authentication failure, the API will return an appropriate error message. Below are the common authentication-related error codes:

  • 401 Unauthorized: This error indicates that the API key is missing, invalid, or expired. Ensure that the Authorization header is properly configured with the correct API key.

  • 403 Forbidden: This error occurs when the API key does not have the required permissions to access the requested resource.

Example of an authentication error response:

{
    "detail": "Forbidden"
}

In such cases, double-check that the API key is valid and that it has the necessary permissions for the API resources you're accessing.

Workspaces

Inflection's developer portal supports a notion of workspaces to allow developers to collaborate sharing keys and billing details.

You can switch between workspaces using the drop down on the left hand side and view members of your current workspace on the Workspace page.

Creation

By default, every user has a personal workspace to which only they belong. You can create a new workspace by:

  1. Go to your Account page and selecting Workspace on the left hand side.
  2. Select the Create workspace button in the top right.
  3. Don't forget to invite other users to your new workspace.

User management

Currently inviting and removing users is only availble to workspace admins.

To invite users to a workspace, navigate to the Workspace page and select the Invite user button. Then, enter the email for the user you wish to invite. The user you are inviting must already have an account on the developer portal.

After a user is invited, the next time they log-in, they will see any workspace invitations at the top of the Playground page where they can select either Accept or Decline.

To remove a user from an organization, navigate to the Workspace page and click on the trash icon associated with the user you wish to remove.

Prompt examples

Building on your understanding of the Inflection AI API and initial experiments, this section provides comprehensive prompt examples designed to demonstrate the versatility and depth of our models. These examples illustrate various use cases, ranging from conversational intelligence to advanced problem-solving, enabling you to harness the full potential of the Pi.

We encourage you to adapt and refine these examples to suit your specific requirements, driving deeper insights and innovation as you engage with our AI platform.

Creativity and learning

Example: Create interesting questions about a topic

Example: Create interesting questions about a topic

Example: Imagine ways to use a technology

Example: Imagine ways to use a technology

Example: Suggest a color from a mood prompt

Example: Suggest a color from a mood prompt

Example: Dream up product names

Example: Dream up product names

Language use

Example: Determine emotion and sentiment

Example: Determine emotion and sentiment

Example: Rewrite text as emojis

Example: Rewrite text as emojis

Example: Create step-by-step instructions

Example: Create step-by-step instructions

Example: Summarize complex topics

Example: Summarize complex topics

Working with data

Example: Extract keywords

Example: Extract keywords

Example: Identify airport codes

Example: Identify airport codes

Example: Format unclear input

Example: Format unclear input

Example: Generate a CSV file

Example: Generate a CSV file

Technical questions

Example: Give a simple explanation of code

Example: Give a simple explanation of code

Example: Find bugs in code

Example: Find bugs in code

Example: Improve code accuracy and efficiency

Example: Improve code accuracy and efficiency 1

Example: Find time complexity

Example: Find time complexity

Version: 6a73ee2© 2024 – Inflection AI
Terms of service