API Keys Guide
This guide provides detailed information on how to create, manage, and secure your Serika.dev API keys.
Creating an API Key
Log in to your Serika.dev account at developers.serika.dev
Navigate to the API Keys section
Click Create New API Key
Enter a descriptive name for your key (e.g., “Development”, “Production”)
Select the permissions you want to grant
Click Create API Key
Copy your new key immediately. You won’t be able to see it again!
sk-abcdefghijklmnopqrstuvwxyz123456789
API Key Permissions
When creating an API key, you can select specific permissions to limit what the key can access:
Permission |
Description |
|---|---|
|
Allow the key to generate text via completion endpoints |
|
Allow the key to generate images |
|
Allow the key to access character information |
|
Allow the key to access user information |
Limiting permissions is a good security practice - only grant the permissions that each integration needs.
Managing Your API Keys
Viewing Your API Keys
Navigate to the Developer Dashboard
Click on API Keys to see a list of all your keys
The list shows each key’s name, creation date, last used date, and status
Regenerating an API Key
If you believe your API key has been compromised:
Find the key in your list
Click Regenerate
Confirm the action
Update your applications with the new key immediately
Note: The old key will stop working instantly.
Deleting an API Key
To permanently remove access:
Find the key in your list
Click Delete
Confirm deletion
API Key Security Best Practices
Never share your API keys in public repositories or client-side code.
Use environment variables to store API keys.
Create separate keys for different environments (dev, prod).
Rotate keys regularly for production applications.
Examples
Here is how to use your API key with different languages.
from openai import OpenAI
client = OpenAI(
base_url="https://api.serika.dev/api/openai/v1",
api_key=os.environ.get("SERIKA_API_KEY"),
)
response = client.chat.completions.create(
model="openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.serika.dev/api/openai/v1',
apiKey: process.env.SERIKA_API_KEY,
});
async function main() {
const response = await client.chat.completions.create({
model: 'openai/gpt-4o-mini',
messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);
}
main();
curl https://api.serika.dev/api/openai/v1/chat/completions \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o-mini",
"messages": [{"role": "user", "content": "Hello!"}]
}'