PromptLayer takes less than 5 minutes to get started.

  • Sign up for an account at
  • Grab an API key from PromptLayer.
  • Grab an API key from OpenAI.

It’s super easy to add PromptLayer to an existing project. Usually only takes one line.

Get started with the code below!

# Make sure to `pip install promptlayer`
import promptlayer

# Swap out your 'from openai import OpenAI'
OpenAI = promptlayer.openai.OpenAI
client = OpenAI()

# Do something fun πŸš€
completion =
    {"role": "system", "content": "You are an AI."},
    {"role": "user", "content": "Compose a poem please."}