Create Sub-API Key
curl --request POST \
--url https://api.io.solutions/v1/api-keys/sub-keys \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"description": "<string>",
"scopes": [
"<string>"
],
"allowed_models": [
"<string>"
],
"credit_limit": 1,
"credit_refresh_cycle": "monthly",
"expires_at": "2023-11-07T05:31:56Z",
"key_prefix": "<string>"
}
'import requests
url = "https://api.io.solutions/v1/api-keys/sub-keys"
payload = {
"description": "<string>",
"scopes": ["<string>"],
"allowed_models": ["<string>"],
"credit_limit": 1,
"credit_refresh_cycle": "monthly",
"expires_at": "2023-11-07T05:31:56Z",
"key_prefix": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
scopes: ['<string>'],
allowed_models: ['<string>'],
credit_limit: 1,
credit_refresh_cycle: 'monthly',
expires_at: '2023-11-07T05:31:56Z',
key_prefix: '<string>'
})
};
fetch('https://api.io.solutions/v1/api-keys/sub-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.io.solutions/v1/api-keys/sub-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([
'description' => '<string>',
'scopes' => [
'<string>'
],
'allowed_models' => [
'<string>'
],
'credit_limit' => 1,
'credit_refresh_cycle' => 'monthly',
'expires_at' => '2023-11-07T05:31:56Z',
'key_prefix' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$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.io.solutions/v1/api-keys/sub-keys"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_models\": [\n \"<string>\"\n ],\n \"credit_limit\": 1,\n \"credit_refresh_cycle\": \"monthly\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"key_prefix\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
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.io.solutions/v1/api-keys/sub-keys")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_models\": [\n \"<string>\"\n ],\n \"credit_limit\": 1,\n \"credit_refresh_cycle\": \"monthly\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"key_prefix\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.io.solutions/v1/api-keys/sub-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_models\": [\n \"<string>\"\n ],\n \"credit_limit\": 1,\n \"credit_refresh_cycle\": \"monthly\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"key_prefix\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "succeeded",
"data": {
"key_id": "71775d2e-fbcc-4ef4-aa30-8aaeb82062c0",
"value": "acme-v2-eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"display": "acme-v2-eyJh...c0eQ",
"admin_user_id": "95ce9361-447f-4ec0-a698-764c2a2d15b9",
"description": "Partner integration key",
"allowed_models": [
"meta-llama/Llama-3.3-70B-Instruct"
],
"credit_limit": 10,
"credit_refresh_cycle": "monthly",
"expires_at": "2026-08-20T00:00:00"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Sub-API Keys
Create Sub-API Key
Creates a new sub-API key scoped under an admin key, with optional model restrictions and per-key credit limits.
POST
/
v1
/
api-keys
/
sub-keys
Create Sub-API Key
curl --request POST \
--url https://api.io.solutions/v1/api-keys/sub-keys \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"description": "<string>",
"scopes": [
"<string>"
],
"allowed_models": [
"<string>"
],
"credit_limit": 1,
"credit_refresh_cycle": "monthly",
"expires_at": "2023-11-07T05:31:56Z",
"key_prefix": "<string>"
}
'import requests
url = "https://api.io.solutions/v1/api-keys/sub-keys"
payload = {
"description": "<string>",
"scopes": ["<string>"],
"allowed_models": ["<string>"],
"credit_limit": 1,
"credit_refresh_cycle": "monthly",
"expires_at": "2023-11-07T05:31:56Z",
"key_prefix": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
scopes: ['<string>'],
allowed_models: ['<string>'],
credit_limit: 1,
credit_refresh_cycle: 'monthly',
expires_at: '2023-11-07T05:31:56Z',
key_prefix: '<string>'
})
};
fetch('https://api.io.solutions/v1/api-keys/sub-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.io.solutions/v1/api-keys/sub-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([
'description' => '<string>',
'scopes' => [
'<string>'
],
'allowed_models' => [
'<string>'
],
'credit_limit' => 1,
'credit_refresh_cycle' => 'monthly',
'expires_at' => '2023-11-07T05:31:56Z',
'key_prefix' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$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.io.solutions/v1/api-keys/sub-keys"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_models\": [\n \"<string>\"\n ],\n \"credit_limit\": 1,\n \"credit_refresh_cycle\": \"monthly\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"key_prefix\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
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.io.solutions/v1/api-keys/sub-keys")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_models\": [\n \"<string>\"\n ],\n \"credit_limit\": 1,\n \"credit_refresh_cycle\": \"monthly\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"key_prefix\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.io.solutions/v1/api-keys/sub-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ],\n \"allowed_models\": [\n \"<string>\"\n ],\n \"credit_limit\": 1,\n \"credit_refresh_cycle\": \"monthly\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"key_prefix\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "succeeded",
"data": {
"key_id": "71775d2e-fbcc-4ef4-aa30-8aaeb82062c0",
"value": "acme-v2-eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"display": "acme-v2-eyJh...c0eQ",
"admin_user_id": "95ce9361-447f-4ec0-a698-764c2a2d15b9",
"description": "Partner integration key",
"allowed_models": [
"meta-llama/Llama-3.3-70B-Instruct"
],
"credit_limit": 10,
"credit_refresh_cycle": "monthly",
"expires_at": "2026-08-20T00:00:00"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}The full key
value is returned only once at creation time. Store it securely — it cannot be retrieved again. Only the truncated display string is stored and returned in subsequent list or usage calls.Only admin API keys can create sub-keys. A sub-key cannot create further sub-keys. If you authenticate with a sub-key, the endpoint returns 403 Forbidden.
Key fields
-
description– A human-readable label to identify the key’s purpose or owner. -
allowed_models– An optional list of model identifiers (e.g."meta-llama/Llama-3.3-70B-Instruct") that this sub-key is permitted to call. If omitted, all models available to the admin are accessible. Requests to unlisted models are rejected with 403 Forbidden. -
credit_limit– Maximum IO Intelligence credits the sub-key may consume per refresh cycle. Once the limit is reached the key is automatically blocked until the cycle resets or the admin raises the limit viaPATCH. Set tonullto impose no per-key cap. -
credit_refresh_cycle– How often the usage counter resets:"8h","daily","weekly", or"monthly"(default). -
expires_at– ISO 8601 date-time for key expiry, or the literal string"never"for a non-expiring key. Defaults to 180 days from creation when omitted. -
key_prefix– An optional lowercase slug (2–8 chars) prepended to the generated key value (e.g."acme"producesacme-v2-eyJ...). Defaults to the standardio-v2prefix when omitted. Cannot start with"io"or contain version markers like"-v2".
Headers
Body
application/json
Custom lowercase slug prepended to the key (e.g. "acme" produces "acme-v2-..."). Must be 2–8 lowercase alphanumeric characters with optional internal hyphens. Cannot start with "io" (reserved) or contain version markers such as "-v2".
Required string length:
2 - 8Pattern:
^[a-z][a-z0-9-]*[a-z0-9]$Was this page helpful?