Skip to content

Getting Started

This guide will help you get started with PureAPI service.

  • OpenAI compatible API client
  • API Key (from console)
  1. Visit PureAPI Console
  2. Register/Login
  3. Create API Key in “Tokens” page

import { Tabs, TabItem } from ‘@astrojs/starlight/components’;

```python from openai import OpenAI
client = OpenAI(
base_url="https://api.pureapi.net/v1",
api_key="sk-your-api-key"
)
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
```
```bash curl https://api.pureapi.net/v1/chat/completions \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4", "messages": [{"role": "user", "content": "Hello!"}] }' ```