Start
Python
Use the standard OpenAI Python client with a SkillRouter base URL.
Install and configure
python -m pip install openai
export SKILLROUTER_API_KEY=sr_test_your_keyimport os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["SKILLROUTER_API_KEY"],
base_url="https://api.useskillrouter.com/v1"
)
response = client.chat.completions.create(
model="anthropic/claude-sonnet",
messages=[
{"role": "user", "content": "Audit this page for SEO."}
],
extra_body={"skill": "seo-audit"}
)
print(response.choices[0].message.content)Keep configuration on the server
- Read the key from an environment variable or secret manager.
- Set request timeouts for the workload and handle normalized SkillRouter errors.
- Record the sr_req_* request ID when you need support or reconciliation.
- Use the test key prefix for development and a separately limited live key for production.