As a reminder, you may not (i) use the Inflection APIs in a way that infringes, misappropriates or violates any person’s rights; (ii) reverse assemble, reverse compile, decompile, translate or otherwise attempt to discover the source code or underlying components of models, algorithms, and systems of the Inflection APIs (except to the extent such restrictions are contrary to applicable law); (iii) use output from the Inflection APIs to develop models that compete with Inflection; (iv) represent that output from the Inflection APIs was human-generated; (v) buy, sell, or transfer API keys without Inflection’s prior consent; or (vi), send Inflection any “personal information”, “personal data”, or any other information that is regulated by applicable laws.
POST https://layercake.pubwestus3.inf7ks8.com/external/api/inference
This endpoint generates a completion to a provided conversation. It requires the following headers, where <token> is the API credential you were provided by Inflection AI.
Authorization: Bearer <token>
The API expects a JSON body, which may include the following fields:
The response will consist of a JSON object containing two fields:
Note that this endpoint is rate limited at 100 requests/min per API key. If you need a higher rate limit, please contact us.
POST /external/api/inference HTTP/1.1
Authorization: Bearer <REDACTED>
Content-Type: application/json
Host: layercake.pubwestus3.inf7ks8.com
{
"config": "inflection_3_pi",
"temperature": 0.8,
"max_tokens": 256,
"top_p": 0.85,
"stop_tokens": ["STOP", "finished"],
"web_search": True,
"context": [
{
"type": "Human",
"text": "What's up?",
"ts": 1708414958660
},
{
"type": "AI",
"text": "Not much, chilling in cyberspace! How about you?"
},
{
"type": "Human",
"text": "Going to get some coffee! Have any recommendations for me?"
}
],
"metadata": {
"user_firstname": "Alice",
"user_timezone": "America/Los_Angeles",
"user_country": "United States of America",
"user_region": "CA",
"user_city": "San Francisco"
}
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"created": 1714688002.0557644,
"text": "Ooh, sounds like a plan! 😎 Here are some coffee spots in San Francisco that I think you'll love:\n\n- Philz Coffee: Known for their unique blends and pour-over method. They offer a wide range of flavors, so you're sure to find something you love!\n- Blue Bottle Coffee: A local favorite that takes pride in their fresh, high-quality coffee beans. Their pour-over coffees are especially delicious!\n- Sightglass Coffee: With a focus on sustainability and ethical sourcing, Sightglass offers a variety of single-origin coffees that are sure to please.\n\nDo any of these sound good to you?"
}
POST https://layercake.pubwestus3.inf7ks8.com/external/api/inference/streaming
This endpoint is a streaming version of /api/inference
. The request headers and body are exactly the
same.
The response will consist of streamed messages containing JSON objects with the following fields:
POST /external/api/inference/streaming HTTP/1.1
Authorization: Bearer <REDACTED>
Content-Type: application/json
Host: layercake.pubwestus3.inf7ks8.com
{
"config": "inflection_3_pi",
"temperature": 0.8,
"max_tokens": 256,
"top_p": 0.85,
"stop_tokens": ["STOP", "finished"],
"web_search": True,
"context": [
{
"type": "Human",
"text": "What's up?"
},
{
"type": "AI",
"text": "Not much, chilling in cyberspace! How about you?"
},
{
"type": "Human",
"text": "Going to get some coffee! Have any recommendations for me?"
}
],
"metadata": {
"user_firstname": "Alice",
"user_timezone": "America/Los_Angeles",
"user_country": "United States of America",
"user_region": "CA",
"user_city": "San Francisco"
}
}
HTTP/1.1 200 OK
Content-Type: application/json
{"created": 1728094708.2514212, "idx": 0, "text": " Ooh, nice"}
{"created": 1728094708.5789802, "idx": 1, "text": "! What kind of coffee mood are you in today?"}
{"created": 1728094709.2364252, "idx": 2, "text": " Do you want something classic like a latte or are you feeling adventurous and wanting to try a new coffee creation? 😋"}
{"created": 1728094709.4067984, "idx": 3, "text": "☕"}