📘
Avian API Documentation
  • GET STARTED
    • Quickstart
    • Dedicated Deployments
    • Key Concepts
    • Models and Pricing
    • Function Calling
    • JSON Mode
  • API REFERENCE
    • Chat Completions
    • Completions
    • Balance
    • Health
    • Specification
Powered by GitBook
On this page
  • Step 1: Create an API Key
  • Send your first request
  1. GET STARTED

Quickstart

This guide will help you get started using the Avian API with Python.

NextDedicated Deployments

Last updated 6 months ago

Avian's API is OpenAI compatible, including their libraries and schema.

Step 1: Create an API Key

First, or .

Next, navigate to the , click "New API Key" and give it a name.

Make sure to save this somewhere safe and do not share it with anyone.

Already familiar? Head over to our .

Send your first request

Create a file named avian-test.py and add the following code:

from openai import OpenAI

client = OpenAI(
    api_key="avian-your-api-key-here",
    base_url="https://api.avian.io/v1"
)

completion = client.chat.completions.create(
  model="Meta-Llama-3.1-405B-Instruct",
  messages=[
    {"role": "system", "content": "You are a poetic assistant, skilled in explaining complex programming concepts with creative flair."},
    {"role": "user", "content": "Compose a poem that explains the concept of recursion in programming."}
  ]
)

print(completion.choices[0].message)

Make sure to change avian-your-api-key-here to your API Key you created.

Run the script:

python avian-test.py

create an Avian account
sign in
API Key page
API Reference