Docs Navigation
Start with the basics and move to production.
Quickstart
Call the API with your project key.
main.py
import requests
resp = requests.post(
"https://api.layer.dev/v1/chat/completions",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"model": "layer-chat-1",
"messages": [
{"role": "user", "content": "Write a hello world function in Python"}
]
}
)
print(resp.json())