Create Developer Key
curl --request POST \
--url https://api.devkit4ai.com/api/v1/auth/developer-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.devkit4ai.com/api/v1/auth/developer-keys"
payload = { "name": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.devkit4ai.com/api/v1/auth/developer-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devkit4ai.com/api/v1/auth/developer-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.devkit4ai.com/api/v1/auth/developer-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.devkit4ai.com/api/v1/auth/developer-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devkit4ai.com/api/v1/auth/developer-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"key": "<string>",
"key_prefix": "<string>",
"is_active": true,
"created_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authentication
Create Developer Key
Create a new developer key for the current developer user.
Maximum of 10 active developer keys per developer.
POST
/
api
/
v1
/
auth
/
developer-keys
Create Developer Key
curl --request POST \
--url https://api.devkit4ai.com/api/v1/auth/developer-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.devkit4ai.com/api/v1/auth/developer-keys"
payload = { "name": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.devkit4ai.com/api/v1/auth/developer-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devkit4ai.com/api/v1/auth/developer-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.devkit4ai.com/api/v1/auth/developer-keys"
payload := strings.NewReader("{\n \"name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.devkit4ai.com/api/v1/auth/developer-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devkit4ai.com/api/v1/auth/developer-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"key": "<string>",
"key_prefix": "<string>",
"is_active": true,
"created_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create a new developer key for API authentication with developer-level permissions. Each developer account can maintain up to 10 active keys for different applications, environments, or team members.
(((REPLACE_THIS_WITH_IMAGE: developer-key-created-success.png: Success message showing newly created developer key with copy button and security warning to store it securely)))
❌ Share keys via insecure channels (email, chat, SMS)
❌ Use the same key across all environments
❌ Keep inactive or unused keys active
❌ Share keys between team members without tracking
Invalid or missing JWT token.
User role is not
The full key value is returned only once in the creation response. Store it securely - it cannot be retrieved later. If you lose the key, you must create a new one and revoke the old key.
Authentication
Requires valid JWT token withdeveloper role and an existing active developer key.
Headers
string
required
Bearer JWT access token obtained from login
string
required
Must be set to
developerstring
required
Existing active developer key for authentication (format:
ak_ + 32 characters)string
required
Must be set to
application/jsonRequest Body
string
Optional descriptive name for the key (max 100 characters). Examples: “Production API”, “Staging Environment”, “CI/CD Pipeline”, “Team Member - John”
Response
string
Unique identifier (UUID) for the newly created developer key
string
Descriptive name for the key (empty string if not provided)
string
Full developer key - shown only once! Format:
ak_ + 32 URL-safe characters (alphanumeric, hyphen, underscore)string
First 8 characters of the key for identification (e.g.,
ak_abc12)boolean
Key status - always
true for newly created keysstring
ISO 8601 timestamp when the key was created
Example Request
curl -X POST https://api.vibecoding.ad/api/v1/auth/developer-keys \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "X-User-Role: developer" \
-H "X-Developer-Key: ak_existing_key_here_12345678901" \
-H "Content-Type: application/json" \
-d '{
"name": "Production API"
}'
Request Without Name
curl -X POST https://api.vibecoding.ad/api/v1/auth/developer-keys \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "X-User-Role: developer" \
-H "X-Developer-Key: ak_existing_key_here_12345678901" \
-H "Content-Type: application/json" \
-d '{}'
Example Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production API",
"key": "ak_abc123XYZ-_789def456ghi012jkl345",
"key_prefix": "ak_abc12",
"is_active": true,
"created_at": "2025-12-08T10:30:00Z"
}
Developer Key Format
Prefix:ak_ (API Key - provides developer-level access)
Structure: ak_ + 32 URL-safe characters (a-z, A-Z, 0-9, hyphen, underscore)
Example: ak_abc123XYZ-_789def456ghi012jkl345
Total Length: 35 characters (3-char prefix + 32-char random key)
Security Properties
- Cryptographically Random: Generated using secure random number generator
- SHA-256 Hashing: Keys are hashed with SHA-256 before database storage
- Prefix Identification: Only first 8 characters (
key_prefix) stored for UI display - One-Time Display: Full key returned only in creation response
- Revocable: Can be deactivated immediately via DELETE endpoint
Key Limits
Each developer account has a maximum limit of 10 active developer keys. If you reach this limit, you must revoke unused keys before creating new ones.
Error When Limit Reached
{
"detail": "Maximum number of developer keys (10) reached. Please revoke unused keys."
}
Use Cases
Environment-Specific Keys
Create separate keys for each deployment environment:interface KeyConfig {
name: string;
environment: 'production' | 'staging' | 'development';
}
async function createEnvironmentKey(
config: KeyConfig,
jwtToken: string,
existingKey: string
): Promise<string> {
const response = await fetch(
'https://api.vibecoding.ad/api/v1/auth/developer-keys',
{
method: 'POST',
headers: {
'Authorization': `Bearer ${jwtToken}`,
'X-User-Role': 'developer',
'X-Developer-Key': existingKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: `${config.environment.toUpperCase()} - ${config.name}`
})
}
);
const data = await response.json();
// Store securely in environment-specific config
console.log(`Created ${config.environment} key: ${data.key_prefix}`);
console.log(`IMPORTANT: Save this key securely: ${data.key}`);
return data.key;
}
// Usage
await createEnvironmentKey(
{ name: 'API Server', environment: 'production' },
jwtToken,
existingKey
);
Team Member Keys
Create individual keys for team members:async function provisionTeamMemberKey(
memberName: string,
jwtToken: string,
adminKey: string
) {
const response = await fetch(
'https://api.vibecoding.ad/api/v1/auth/developer-keys',
{
method: 'POST',
headers: {
'Authorization': `Bearer ${jwtToken}`,
'X-User-Role': 'developer',
'X-Developer-Key': adminKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: `Team Member - ${memberName}`
})
}
);
const data = await response.json();
// Send key securely to team member (encrypted email, password manager, etc.)
return {
key: data.key,
keyId: data.id,
createdAt: data.created_at
};
}
Key Rotation Workflow
Implement automated key rotation:async function rotateKey(
oldKeyId: string,
keyName: string,
jwtToken: string,
currentKey: string
): Promise<string> {
// Step 1: Create new key
const createResponse = await fetch(
'https://api.vibecoding.ad/api/v1/auth/developer-keys',
{
method: 'POST',
headers: {
'Authorization': `Bearer ${jwtToken}`,
'X-User-Role': 'developer',
'X-Developer-Key': currentKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({ name: `${keyName} (Rotated)` })
}
);
const newKey = await createResponse.json();
// Step 2: Update application configuration with new key
await updateApplicationConfig(newKey.key);
// Step 3: Verify new key works
await testKeyAuthentication(newKey.key);
// Step 4: Revoke old key
await fetch(
`https://api.vibecoding.ad/api/v1/auth/developer-keys/${oldKeyId}`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${jwtToken}`,
'X-User-Role': 'developer',
'X-Developer-Key': newKey.key // Use new key to revoke old one
}
}
);
console.log(`Key rotation complete: ${oldKeyId} → ${newKey.id}`);
return newKey.key;
}
Security Best Practices
Immediate Storage Required: Copy and securely store the full key immediately after creation. The API will never display the full key again.
Recommended Practices
- Secure Storage: Store keys in environment variables, secrets managers (AWS Secrets Manager, HashiCorp Vault), or password managers - never in code repositories
- Descriptive Naming: Use clear names indicating purpose and environment (e.g., “Production API v2”, “Staging - Mobile App”)
- Regular Rotation: Rotate keys every 90 days or when team members leave
- Principle of Least Privilege: Create separate keys for different applications/services rather than sharing one key
- Immediate Revocation: Revoke keys immediately if compromised or no longer needed
- Audit Trail: Document key creation, distribution, and revocation in your security logs
What NOT to Do
❌ Store keys in code repositories or version control❌ Share keys via insecure channels (email, chat, SMS)
❌ Use the same key across all environments
❌ Keep inactive or unused keys active
❌ Share keys between team members without tracking
Error Responses
Maximum Keys Reached (400)
{
"detail": "Maximum number of developer keys (10) reached. Please revoke unused keys."
}
Unauthorized (401)
{
"detail": "Could not validate credentials"
}
Forbidden (403)
{
"detail": "Insufficient permissions"
}
developer or developer key is invalid/revoked.
Invalid Request Body (422)
{
"detail": [
{
"loc": ["body", "name"],
"msg": "ensure this value has at most 100 characters",
"type": "value_error.any_str.max_length"
}
]
}
Related Pages
List Developer Keys
View all active developer keys
Revoke Developer Key
Deactivate keys immediately
Cloud Admin UI Guide
Create keys via web interface
Security Practices
Key management best practices
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Request payload for creating a new developer key
Maximum string length:
255
