PromptLayer takes less than 5 minutes to get started.

  • Sign up for an account at www.promptlayer.com
  • 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`
from promptlayer import PromptLayer
promptlayer_client = PromptLayer()

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

# Do something fun πŸš€
completion = client.chat.completions.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "system", "content": "You are an AI."},
    {"role": "user", "content": "Compose a poem please."}
  ],
  pl_tags=["getting-started"]
)