Inference
GET
/v1/models Models this key can call. Id is the public id, such as cc/claude-opus-4-6.
Inference key https://api.aikeys.co
Field In Required Detail Authorization header yes Bearer secret, or send x-api-key instead.
cURL Python SDK Node SDK Go SDK
Copy Python uses the OpenAI SDK. TypeScript uses the openai Node SDK. Both point base URL at AIKeys.
curl https://api.aikeys.co/v1/models \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl https://api.aikeys.co/v1/models \
-H "Authorization: Bearer $AIKEYS_CO_KEY" from openai import OpenAI
client = OpenAI ( api_key = " sk-... " , base_url = " https://api.aikeys.co/v1 " )
for model in client . models . list ():
print ( model . id ) from openai import OpenAI
client = OpenAI(api_key="sk-...", base_url="https://api.aikeys.co/v1")
for model in client.models.list():
print(model.id) import OpenAI from " openai " ;
const client = new OpenAI ({
apiKey : process . env . AIKEYS_CO_KEY ,
baseURL : " https://api.aikeys.co/v1 " ,
});
for await ( const model of client . models . list ()) {
console . log ( model . id );
} import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AIKEYS_CO_KEY,
baseURL: "https://api.aikeys.co/v1",
});
for await (const model of client.models.list()) {
console.log(model.id);
} package main
import (
" context "
" fmt "
" os "
" github.com/openai/openai-go "
" github.com/openai/openai-go/option "
)
func main () {
client := openai . NewClient (
option . WithAPIKey ( os . Getenv ( " AIKEYS_CO_KEY " )),
option . WithBaseURL ( " https://api.aikeys.co/v1 " ),
)
page , err := client . Models . List ( context . Background ())
if err != nil {
panic ( err )
}
for _ , model := range page . Data {
fmt . Println ( model . ID )
}
} package main
import (
"context"
"fmt"
"os"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey(os.Getenv("AIKEYS_CO_KEY")),
option.WithBaseURL("https://api.aikeys.co/v1"),
)
page, err := client.Models.List(context.Background())
if err != nil {
panic(err)
}
for _, model := range page.Data {
fmt.Println(model.ID)
}
} Response {
" object " : " list " ,
" data " : [
{ " id " : " cc/claude-haiku-4-5 " , " object " : " model " , " owned_by " : " aikeys " }
]
} Inference
POST
/v1/chat/completions OpenAI chat completions. Required fields are model and messages. stream: true is server-sent events, flushed per chunk. The proxy does not buffer the full reply. Price headers are ignored. You pay the cheapest live ask, never more than half the official price.
Inference key https://api.aikeys.co
Field In Required Detail model body yes Public id only. No combo/, free/, or bare alias. messages body yes OpenAI message array. stream body no true returns text/event-stream. max_tokens body no Used to size the wallet hold. Default hold output is 4096 tokens. temperature body no Passed through when the upstream accepts it.
cURL Python SDK Node SDK Go SDK
Copy Python uses the OpenAI SDK. TypeScript uses the openai Node SDK. Both point base URL at AIKeys.
curl https://api.aikeys.co/v1/chat/completions \
-H " Authorization: Bearer $AIKEYS_CO_KEY " \
-H " Content-Type: application/json " \
-d ' {"model":"cc/claude-haiku-4-5","messages":[{"role":"user","content":"Hello"}]} ' curl https://api.aikeys.co/v1/chat/completions \
-H "Authorization: Bearer $AIKEYS_CO_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"cc/claude-haiku-4-5","messages":[{"role":"user","content":"Hello"}]}' from openai import OpenAI
client = OpenAI (
api_key = " sk-... " ,
base_url = " https://api.aikeys.co/v1 " ,
)
resp = client . chat . completions . create (
model = " cc/claude-haiku-4-5 " ,
messages = [{ " role " : " user " , " content " : " Hello " }],
)
print ( resp . choices [ 0 ]. message . content ) from openai import OpenAI
client = OpenAI(
api_key="sk-...",
base_url="https://api.aikeys.co/v1",
)
resp = client.chat.completions.create(
model="cc/claude-haiku-4-5",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content) import OpenAI from " openai " ;
const client = new OpenAI ({
apiKey : process . env . AIKEYS_CO_KEY ,
baseURL : " https://api.aikeys.co/v1 " ,
});
const resp = await client . chat . completions . create ({
model : " cc/claude-haiku-4-5 " ,
messages : [{ role : " user " , content : " Hello " }],
});
console . log ( resp . choices [ 0 ]?. message . content ); import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AIKEYS_CO_KEY,
baseURL: "https://api.aikeys.co/v1",
});
const resp = await client.chat.completions.create({
model: "cc/claude-haiku-4-5",
messages: [{ role: "user", content: "Hello" }],
});
console.log(resp.choices[0]?.message.content); package main
import (
" context "
" fmt "
" os "
" github.com/openai/openai-go "
" github.com/openai/openai-go/option "
)
func main () {
client := openai . NewClient (
option . WithAPIKey ( os . Getenv ( " AIKEYS_CO_KEY " )),
option . WithBaseURL ( " https://api.aikeys.co/v1 " ),
)
resp , err := client . Chat . Completions . New ( context . Background (), openai . ChatCompletionNewParams {
Model : " cc/claude-haiku-4-5 " ,
Messages : [] openai . ChatCompletionMessageParamUnion {
openai . UserMessage ( " Hello " ),
},
})
if err != nil {
panic ( err )
}
fmt . Println ( resp . Choices [ 0 ]. Message . Content )
} package main
import (
"context"
"fmt"
"os"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey(os.Getenv("AIKEYS_CO_KEY")),
option.WithBaseURL("https://api.aikeys.co/v1"),
)
resp, err := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
Model: "cc/claude-haiku-4-5",
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Hello"),
},
})
if err != nil {
panic(err)
}
fmt.Println(resp.Choices[0].Message.Content)
} Response {
" id " : " chatcmpl_01HZX " ,
" object " : " chat.completion " ,
" model " : " cc/claude-haiku-4-5 " ,
" choices " : [
{ " index " : 0 , " message " : { " role " : " assistant " , " content " : " Hello. " }, " finish_reason " : " stop " }
],
" usage " : { " prompt_tokens " : 12 , " completion_tokens " : 4 , " total_tokens " : 16 }
} Inference
POST
/v1/messages Anthropic Messages. Required fields are model, max_tokens, and messages. Point Anthropic clients at https://api.aikeys.co and let them append /v1. stream: true uses Anthropic’s event stream.
Inference key https://api.aikeys.co
Field In Required Detail model body yes Public id, for example cc/claude-haiku-4-5. max_tokens body yes Anthropic requires this. It also sizes the hold. messages body yes Anthropic message array. anthropic-version header no Passed through. Default 2023-06-01 when the client omits it. stream body no true flushes Anthropic events as they arrive.
cURL Python SDK Node SDK Go
Copy Python uses the Anthropic SDK. TypeScript uses @anthropic-ai/sdk. The base URL is https://api.aikeys.co. The SDK appends /v1.
curl https://api.aikeys.co/v1/messages \
-H " x-api-key: $AIKEYS_CO_KEY " \
-H " anthropic-version: 2023-06-01 " \
-H " Content-Type: application/json " \
-d ' {"model":"cc/claude-haiku-4-5","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]} ' curl https://api.aikeys.co/v1/messages \
-H "x-api-key: $AIKEYS_CO_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"cc/claude-haiku-4-5","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]}' import anthropic
client = anthropic . Anthropic (
api_key = " sk-... " ,
base_url = " https://api.aikeys.co " ,
)
msg = client . messages . create (
model = " cc/claude-haiku-4-5 " ,
max_tokens = 256 ,
messages = [{ " role " : " user " , " content " : " Hello " }],
)
print ( msg . content [ 0 ]. text ) import anthropic
client = anthropic.Anthropic(
api_key="sk-...",
base_url="https://api.aikeys.co",
)
msg = client.messages.create(
model="cc/claude-haiku-4-5",
max_tokens=256,
messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text) import Anthropic from " @anthropic-ai/sdk " ;
const client = new Anthropic ({
apiKey : process . env . AIKEYS_CO_KEY ,
baseURL : " https://api.aikeys.co " ,
});
const msg = await client . messages . create ({
model : " cc/claude-haiku-4-5 " ,
max_tokens : 256 ,
messages : [{ role : " user " , content : " Hello " }],
});
console . log ( msg . content [ 0 ]. type === " text " ? msg . content [ 0 ]. text : msg . content ); import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.AIKEYS_CO_KEY,
baseURL: "https://api.aikeys.co",
});
const msg = await client.messages.create({
model: "cc/claude-haiku-4-5",
max_tokens: 256,
messages: [{ role: "user", content: "Hello" }],
});
console.log(msg.content[0].type === "text" ? msg.content[0].text : msg.content); package main
import (
" bytes "
" fmt "
" net/http "
" os "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"model":"cc/claude-haiku-4-5","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]} ` ))
req , err := http . NewRequest ( " POST " , " https://api.aikeys.co/v1/messages " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " x-api-key " , os . Getenv ( " AIKEYS_CO_KEY " ))
req . Header . Set ( " anthropic-version " , " 2023-06-01 " )
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
body := bytes.NewReader([]byte(`{"model":"cc/claude-haiku-4-5","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]}`))
req, err := http.NewRequest("POST", "https://api.aikeys.co/v1/messages", body)
if err != nil {
panic(err)
}
req.Header.Set("x-api-key", os.Getenv("AIKEYS_CO_KEY"))
req.Header.Set("anthropic-version", "2023-06-01")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" id " : " msg_01HZX " ,
" type " : " message " ,
" role " : " assistant " ,
" model " : " cc/claude-haiku-4-5 " ,
" content " : [{ " type " : " text " , " text " : " Hello. " }],
" stop_reason " : " end_turn " ,
" usage " : { " input_tokens " : 12 , " output_tokens " : 4 }
} Inference
POST
/v1/responses OpenAI Responses. Required fields are model and input. stream: true uses the Responses event stream. The proxy translates the body into the upstream protocol.
Inference key https://api.aikeys.co
Field In Required Detail model body yes Public id. input body yes String or Responses input items. stream body no true returns the Responses event stream.
cURL Python SDK Node SDK Go SDK
Copy Python uses the OpenAI SDK. TypeScript uses the openai Node SDK. Both point base URL at AIKeys.
curl https://api.aikeys.co/v1/responses \
-H " Authorization: Bearer $AIKEYS_CO_KEY " \
-H " Content-Type: application/json " \
-d ' {"model":"cc/claude-haiku-4-5","input":"Hello"} ' curl https://api.aikeys.co/v1/responses \
-H "Authorization: Bearer $AIKEYS_CO_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"cc/claude-haiku-4-5","input":"Hello"}' from openai import OpenAI
client = OpenAI ( api_key = " sk-... " , base_url = " https://api.aikeys.co/v1 " )
resp = client . responses . create (
model = " cc/claude-haiku-4-5 " ,
input = " Hello " ,
)
print ( resp . output_text ) from openai import OpenAI
client = OpenAI(api_key="sk-...", base_url="https://api.aikeys.co/v1")
resp = client.responses.create(
model="cc/claude-haiku-4-5",
input="Hello",
)
print(resp.output_text) import OpenAI from " openai " ;
const client = new OpenAI ({
apiKey : process . env . AIKEYS_CO_KEY ,
baseURL : " https://api.aikeys.co/v1 " ,
});
const resp = await client . responses . create ({
model : " cc/claude-haiku-4-5 " ,
input : " Hello " ,
});
console . log ( resp . output_text ); import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.AIKEYS_CO_KEY,
baseURL: "https://api.aikeys.co/v1",
});
const resp = await client.responses.create({
model: "cc/claude-haiku-4-5",
input: "Hello",
});
console.log(resp.output_text); package main
import (
" context "
" fmt "
" os "
" github.com/openai/openai-go "
" github.com/openai/openai-go/option "
)
func main () {
client := openai . NewClient (
option . WithAPIKey ( os . Getenv ( " AIKEYS_CO_KEY " )),
option . WithBaseURL ( " https://api.aikeys.co/v1 " ),
)
resp , err := client . Responses . New ( context . Background (), openai . ResponseNewParams {
Model : " cc/claude-haiku-4-5 " ,
Input : openai . ResponseNewParamsInputUnion { OfString : openai . String ( " Hello " )},
})
if err != nil {
panic ( err )
}
fmt . Println ( resp . OutputText ())
} package main
import (
"context"
"fmt"
"os"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey(os.Getenv("AIKEYS_CO_KEY")),
option.WithBaseURL("https://api.aikeys.co/v1"),
)
resp, err := client.Responses.New(context.Background(), openai.ResponseNewParams{
Model: "cc/claude-haiku-4-5",
Input: openai.ResponseNewParamsInputUnion{OfString: openai.String("Hello")},
})
if err != nil {
panic(err)
}
fmt.Println(resp.OutputText())
} Response {
" id " : " resp_01HZX " ,
" object " : " response " ,
" model " : " cc/claude-haiku-4-5 " ,
" output_text " : " Hello. " ,
" usage " : { " input_tokens " : 8 , " output_tokens " : 3 }
} Session
POST
/api/auth/signup Create an account, both wallets at zero, and email a verification code. Password is stored as a scrypt hash. Always 200 when the body is valid and the email is free.
Public https://aikeys.co
Field In Required Detail email body yes Account email. password body yes At least 8 characters. display_name body no Shown on the dashboard. Falls back to the email local-part.
cURL Python TypeScript Go
Copy No Authorization header.
curl -X POST https://aikeys.co/api/auth/signup \
-H " Content-Type: application/json " \
-d ' {"email":"[email protected] ","password":"at-least-8","display_name":"Ada"} ' curl -X POST https://aikeys.co/api/auth/signup \
-H "Content-Type: application/json" \
-d '{"email":"[email protected] ","password":"at-least-8","display_name":"Ada"}' import requests
resp = requests . post (
" https://aikeys.co/api/auth/signup " ,
json = { " email " : " [email protected] " , " password " : " at-least-8 " , " display_name " : " Ada " },
)
resp . raise_for_status ()
print ( resp . json ()) import requests
resp = requests.post(
"https://aikeys.co/api/auth/signup",
json={"email":"[email protected] ","password":"at-least-8","display_name":"Ada"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/auth/signup " , {
method : " POST " ,
headers : {
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " email " : " [email protected] " , " password " : " at-least-8 " , " display_name " : " Ada " }),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/auth/signup", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"email":"[email protected] ","password":"at-least-8","display_name":"Ada"}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"email":"[email protected] ","password":"at-least-8","display_name":"Ada"} ` ))
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/auth/signup " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
)
func main() {
body := bytes.NewReader([]byte(`{"email":"[email protected] ","password":"at-least-8","display_name":"Ada"}`))
req, err := http.NewRequest("POST", "https://aikeys.co/api/auth/signup", body)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response Session
POST
/api/auth/verify-email Consume the signup code and set email_verified_at. Unverified accounts cannot sign in.
Public https://aikeys.co
Field In Required Detail email body yes Same email used at signup. code body yes Code from the signup email.
cURL Python TypeScript Go
Copy No Authorization header.
curl -X POST https://aikeys.co/api/auth/verify-email \
-H " Content-Type: application/json " \
-d ' {"email":"[email protected] ","code":"123456"} ' curl -X POST https://aikeys.co/api/auth/verify-email \
-H "Content-Type: application/json" \
-d '{"email":"[email protected] ","code":"123456"}' import requests
resp = requests . post (
" https://aikeys.co/api/auth/verify-email " ,
json = { " email " : " [email protected] " , " code " : " 123456 " },
)
resp . raise_for_status ()
print ( resp . json ()) import requests
resp = requests.post(
"https://aikeys.co/api/auth/verify-email",
json={"email":"[email protected] ","code":"123456"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/auth/verify-email " , {
method : " POST " ,
headers : {
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " email " : " [email protected] " , " code " : " 123456 " }),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/auth/verify-email", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"email":"[email protected] ","code":"123456"}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"email":"[email protected] ","code":"123456"} ` ))
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/auth/verify-email " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
)
func main() {
body := bytes.NewReader([]byte(`{"email":"[email protected] ","code":"123456"}`))
req, err := http.NewRequest("POST", "https://aikeys.co/api/auth/verify-email", body)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response Session
POST
/api/auth/login Set the aikeys_session cookie. Response matches GET /api/me. Login before the email code is consumed returns 422 unverified.
Session cookie https://aikeys.co
Field In Required Detail email body yes Account email. password body yes Account password.
cURL Python TypeScript Go
Copy No key on the request. -c cookies.txt stores aikeys_session from Set-Cookie.
curl -X POST https://aikeys.co/api/auth/login \
-c cookies.txt -b cookies.txt \
-H " Content-Type: application/json " \
-d ' {"email":"[email protected] ","password":"at-least-8"} ' curl -X POST https://aikeys.co/api/auth/login \
-c cookies.txt -b cookies.txt \
-H "Content-Type: application/json" \
-d '{"email":"[email protected] ","password":"at-least-8"}' import requests
resp = requests . post (
" https://aikeys.co/api/auth/login " ,
json = { " email " : " [email protected] " , " password " : " at-least-8 " },
)
resp . raise_for_status ()
print ( resp . json ()) import requests
resp = requests.post(
"https://aikeys.co/api/auth/login",
json={"email":"[email protected] ","password":"at-least-8"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/auth/login " , {
method : " POST " ,
headers : {
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " email " : " [email protected] " , " password " : " at-least-8 " }),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/auth/login", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"email":"[email protected] ","password":"at-least-8"}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"email":"[email protected] ","password":"at-least-8"} ` ))
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/auth/login " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
)
func main() {
body := bytes.NewReader([]byte(`{"email":"[email protected] ","password":"at-least-8"}`))
req, err := http.NewRequest("POST", "https://aikeys.co/api/auth/login", body)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" id " : " usr_01HZX " ,
" email " : " [email protected] " ,
" display_name " : " Ada " ,
" role " : " member " ,
" email_verified " : true ,
" consumer_available " : " 0.000000000000 " ,
" publisher_available " : " 0.000000000000 "
} Session
POST
/api/auth/logout Clear the cookie and delete the Redis session.
Session cookie https://aikeys.co
cURL Python TypeScript Go
Copy Browser session cookie aikeys_session. An API key cannot call this route.
curl -X POST https://aikeys.co/api/auth/logout \
-c cookies.txt -b cookies.txt curl -X POST https://aikeys.co/api/auth/logout \
-c cookies.txt -b cookies.txt import os
import requests
session = requests . Session ()
session . cookies . set ( " aikeys_session " , os . environ [ " AIKEYS_SESSION " ])
resp = session . post (
" https://aikeys.co/api/auth/logout " ,
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
session = requests.Session()
session.cookies.set("aikeys_session", os.environ["AIKEYS_SESSION"])
resp = session.post(
"https://aikeys.co/api/auth/logout",
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/auth/logout " , {
method : " POST " ,
credentials : " include " ,
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/auth/logout", {
method: "POST",
credentials: "include",
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/auth/logout " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Cookie " , " aikeys_session= " + os . Getenv ( " AIKEYS_SESSION " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", "https://aikeys.co/api/auth/logout", nil)
if err != nil {
panic(err)
}
req.Header.Set("Cookie", "aikeys_session="+os.Getenv("AIKEYS_SESSION"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response Session
POST
/api/auth/forgot Always returns ok. If the account exists, a password_reset code is stored. The response does not reveal whether the email exists.
Public https://aikeys.co
Field In Required Detail email body yes Address to mail, when an account exists.
cURL Python TypeScript Go
Copy No Authorization header.
curl -X POST https://aikeys.co/api/auth/forgot \
-H " Content-Type: application/json " \
-d ' {"email":"[email protected] "} ' curl -X POST https://aikeys.co/api/auth/forgot \
-H "Content-Type: application/json" \
-d '{"email":"[email protected] "}' import requests
resp = requests . post (
" https://aikeys.co/api/auth/forgot " ,
json = { " email " : " [email protected] " },
)
resp . raise_for_status ()
print ( resp . json ()) import requests
resp = requests.post(
"https://aikeys.co/api/auth/forgot",
json={"email":"[email protected] "},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/auth/forgot " , {
method : " POST " ,
headers : {
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " email " : " [email protected] " }),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/auth/forgot", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"email":"[email protected] "}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"email":"[email protected] "} ` ))
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/auth/forgot " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
)
func main() {
body := bytes.NewReader([]byte(`{"email":"[email protected] "}`))
req, err := http.NewRequest("POST", "https://aikeys.co/api/auth/forgot", body)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response Session
POST
/api/auth/reset Consume the reset code, replace the password hash, and increment session_version so other sessions drop.
Public https://aikeys.co
Field In Required Detail email body yes Account email. code body yes Reset code. password body yes New password, at least 8 characters.
cURL Python TypeScript Go
Copy No Authorization header.
curl -X POST https://aikeys.co/api/auth/reset \
-H " Content-Type: application/json " \
-d ' {"email":"[email protected] ","code":"123456","password":"new-password"} ' curl -X POST https://aikeys.co/api/auth/reset \
-H "Content-Type: application/json" \
-d '{"email":"[email protected] ","code":"123456","password":"new-password"}' import requests
resp = requests . post (
" https://aikeys.co/api/auth/reset " ,
json = { " email " : " [email protected] " , " code " : " 123456 " , " password " : " new-password " },
)
resp . raise_for_status ()
print ( resp . json ()) import requests
resp = requests.post(
"https://aikeys.co/api/auth/reset",
json={"email":"[email protected] ","code":"123456","password":"new-password"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/auth/reset " , {
method : " POST " ,
headers : {
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " email " : " [email protected] " , " code " : " 123456 " , " password " : " new-password " }),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/auth/reset", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"email":"[email protected] ","code":"123456","password":"new-password"}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"email":"[email protected] ","code":"123456","password":"new-password"} ` ))
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/auth/reset " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
)
func main() {
body := bytes.NewReader([]byte(`{"email":"[email protected] ","code":"123456","password":"new-password"}`))
req, err := http.NewRequest("POST", "https://aikeys.co/api/auth/reset", body)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response Account
GET
/api/me Current account, role, verification, and both purse balances. Money values are decimal strings.
API key https://aikeys.co
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl https://aikeys.co/api/me \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl https://aikeys.co/api/me \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . get (
" https://aikeys.co/api/me " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.get(
"https://aikeys.co/api/me",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/me " , {
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/me", {
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/me " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/me", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" id " : " usr_01HZX " ,
" email " : " [email protected] " ,
" display_name " : " Ada " ,
" role " : " member " ,
" email_verified " : true ,
" consumer_available " : " 12.400000000000 " ,
" publisher_available " : " 0.000000000000 "
} Keys
GET
/api/keys List keys for this account. Secrets are never returned. Each row has name, type, 12-character prefix, created_at, last_used_at, and revoked.
API key https://aikeys.co
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl https://aikeys.co/api/keys \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl https://aikeys.co/api/keys \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . get (
" https://aikeys.co/api/keys " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.get(
"https://aikeys.co/api/keys",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/keys " , {
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/keys", {
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/keys " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/keys", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" keys " : [
{
" id " : " key_01HZX " ,
" name " : " laptop " ,
" key_type " : " inference " ,
" prefix " : " sk-ak-a1b2c3 " ,
" created_at " : " 2026-10-10T00:00:00Z " ,
" last_used_at " : null ,
" revoked " : false
}
]
} Keys
POST
/api/keys Create a key. The secret is returned once. key_type is inference, config_write, or config_read.
API key https://aikeys.co
Field In Required Detail name body yes Label shown in the dashboard. key_type body yes inference, config_write, or config_read.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X POST https://aikeys.co/api/keys \
-H " Authorization: Bearer $AIKEYS_CO_KEY " \
-H " Content-Type: application/json " \
-d ' {"name":"laptop","key_type":"inference"} ' curl -X POST https://aikeys.co/api/keys \
-H "Authorization: Bearer $AIKEYS_CO_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"laptop","key_type":"inference"}' import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . post (
" https://aikeys.co/api/keys " ,
headers = { " Authorization " : f "Bearer { key } " },
json = { " name " : " laptop " , " key_type " : " inference " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.post(
"https://aikeys.co/api/keys",
headers={"Authorization": f"Bearer {key}"},
json={"name":"laptop","key_type":"inference"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/keys " , {
method : " POST " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " name " : " laptop " , " key_type " : " inference " }),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/keys", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"name":"laptop","key_type":"inference"}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
" os "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"name":"laptop","key_type":"inference"} ` ))
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/keys " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
body := bytes.NewReader([]byte(`{"name":"laptop","key_type":"inference"}`))
req, err := http.NewRequest("POST", "https://aikeys.co/api/keys", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" id " : " key_01HZX " ,
" name " : " laptop " ,
" key_type " : " inference " ,
" prefix " : " sk-a1b2c3d4e5 " ,
" secret " : " sk-ak-… "
} Keys
POST
/api/keys/{id}/revoke Stop the key immediately. Sets revoked_at on the key and its hashes.
API key https://aikeys.co
Field In Required Detail id path yes Public key id, key_….
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X POST https://aikeys.co/api/keys/key_01HZX/revoke \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl -X POST https://aikeys.co/api/keys/key_01HZX/revoke \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . post (
" https://aikeys.co/api/keys/key_01HZX/revoke " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.post(
"https://aikeys.co/api/keys/key_01HZX/revoke",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/keys/key_01HZX/revoke " , {
method : " POST " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/keys/key_01HZX/revoke", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/keys/key_01HZX/revoke " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", "https://aikeys.co/api/keys/key_01HZX/revoke", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response { " id " : " key_01HZX " , " revoked " : true } Keys
POST
/api/keys/{id}/rotate Issue a new secret. The previous secret keeps working until grace_ends_at, 24 hours out.
API key https://aikeys.co
Field In Required Detail id path yes Public key id.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X POST https://aikeys.co/api/keys/key_01HZX/rotate \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl -X POST https://aikeys.co/api/keys/key_01HZX/rotate \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . post (
" https://aikeys.co/api/keys/key_01HZX/rotate " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.post(
"https://aikeys.co/api/keys/key_01HZX/rotate",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/keys/key_01HZX/rotate " , {
method : " POST " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/keys/key_01HZX/rotate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/keys/key_01HZX/rotate " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", "https://aikeys.co/api/keys/key_01HZX/rotate", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" id " : " key_01HZX " ,
" secret " : " sk-ak-… " ,
" grace_ends_at " : " 2026-10-11T00:00:00Z "
} Usage
GET
/api/usage Recent requests plus totals by model and upstream. from and to are RFC3339. The default window is the last 24 hours. Windows of 24 hours or less read usage.requests. Longer windows read daily rollups.
API key https://aikeys.co
Field In Required Detail from query no RFC3339 start. Default is 24 hours ago. to query no RFC3339 end. upstream query no Upstream code, such as cc. model query no Public model id. key query no Public key id. status query no ok or error. limit query no Page size for the request list.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl https://aikeys.co/api/usage?limit= 50 \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl https://aikeys.co/api/usage?limit=50 \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . get (
" https://aikeys.co/api/usage?limit=50 " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.get(
"https://aikeys.co/api/usage?limit=50",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/usage?limit=50 " , {
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/usage?limit=50", {
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/usage?limit=50 " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/usage?limit=50", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" requests " : [],
" by_model " : [],
" by_upstream " : []
} Models
GET
/api/models Signed-in catalog: upstream, model, official prices, lowest ask, and whether this account has the model enabled.
API key https://aikeys.co
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl https://aikeys.co/api/models \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl https://aikeys.co/api/models \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . get (
" https://aikeys.co/api/models " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.get(
"https://aikeys.co/api/models",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/models " , {
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/models", {
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/models " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/models", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" models " : [
{
" id " : " cc/claude-haiku-4-5 " ,
" upstream " : " cc " ,
" official_input " : " 1.00 " ,
" official_output " : " 5.00 " ,
" ask_input " : " 0.40 " ,
" ask_output " : " 2.00 " ,
" enabled " : true
}
]
} Models
PUT
/api/models/prefs Enable or disable one upstream or one model for this account. A missing preference means enabled. Session or config_write key. Inference keys cannot write this.
API key https://aikeys.co
Field In Required Detail model_id body one of Public id. Omit when sending upstream_code. upstream_code body one of Disable or enable every model on that upstream. enabled body yes true or false.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X PUT https://aikeys.co/api/models/prefs \
-H " Authorization: Bearer $AIKEYS_CO_KEY " \
-H " Content-Type: application/json " \
-d ' {"model_id":"cc/claude-opus-4-6","enabled":false} ' curl -X PUT https://aikeys.co/api/models/prefs \
-H "Authorization: Bearer $AIKEYS_CO_KEY" \
-H "Content-Type: application/json" \
-d '{"model_id":"cc/claude-opus-4-6","enabled":false}' import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . put (
" https://aikeys.co/api/models/prefs " ,
headers = { " Authorization " : f "Bearer { key } " },
json = { " model_id " : " cc/claude-opus-4-6 " , " enabled " : false },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.put(
"https://aikeys.co/api/models/prefs",
headers={"Authorization": f"Bearer {key}"},
json={"model_id":"cc/claude-opus-4-6","enabled":false},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/models/prefs " , {
method : " PUT " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " model_id " : " cc/claude-opus-4-6 " , " enabled " : false }),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/models/prefs", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"model_id":"cc/claude-opus-4-6","enabled":false}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
" os "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"model_id":"cc/claude-opus-4-6","enabled":false} ` ))
req , err := http . NewRequest ( " PUT " , " https://aikeys.co/api/models/prefs " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
body := bytes.NewReader([]byte(`{"model_id":"cc/claude-opus-4-6","enabled":false}`))
req, err := http.NewRequest("PUT", "https://aikeys.co/api/models/prefs", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response { " model_id " : " cc/claude-opus-4-6 " , " enabled " : false } Models
GET
/api/pricing Public price list. Same rows as the catalog without this account’s enablement flags. Cached for 5 seconds.
Public https://aikeys.co
cURL Python TypeScript Go
Copy No key. Cached for 5 seconds.
curl https://aikeys.co/api/pricing curl https://aikeys.co/api/pricing import requests
resp = requests . get (
" https://aikeys.co/api/pricing " ,
)
resp . raise_for_status ()
print ( resp . json ()) import requests
resp = requests.get(
"https://aikeys.co/api/pricing",
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/pricing " , {
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/pricing", {
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/pricing " , nil )
if err != nil {
panic ( err )
}
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/pricing", nil)
if err != nil {
panic(err)
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" models " : [
{
" id " : " cc/claude-haiku-4-5 " ,
" ask_input " : " 0.40 " ,
" ask_output " : " 2.00 " ,
" available " : true
}
]
} Billing
GET
/api/billing/balance Consumer and publisher available and held balances. Held is a preauth on the consumer purse.
API key https://aikeys.co
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl https://aikeys.co/api/billing/balance \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl https://aikeys.co/api/billing/balance \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . get (
" https://aikeys.co/api/billing/balance " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.get(
"https://aikeys.co/api/billing/balance",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/billing/balance " , {
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/billing/balance", {
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/billing/balance " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/billing/balance", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" consumer_available " : " 12.400000000000 " ,
" consumer_held " : " 0.010000000000 " ,
" publisher_available " : " 3.200000000000 " ,
" publisher_held " : " 0.000000000000 "
} Billing
GET
/api/billing/deposit-address Return this account’s active Solana deposit address, creating one if needed. Session only. Send only USDC on Solana.
Session cookie https://aikeys.co
cURL Python TypeScript Go
Copy Browser session cookie aikeys_session. An API key cannot call this route.
curl https://aikeys.co/api/billing/deposit-address \
-c cookies.txt -b cookies.txt curl https://aikeys.co/api/billing/deposit-address \
-c cookies.txt -b cookies.txt import os
import requests
session = requests . Session ()
session . cookies . set ( " aikeys_session " , os . environ [ " AIKEYS_SESSION " ])
resp = session . get (
" https://aikeys.co/api/billing/deposit-address " ,
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
session = requests.Session()
session.cookies.set("aikeys_session", os.environ["AIKEYS_SESSION"])
resp = session.get(
"https://aikeys.co/api/billing/deposit-address",
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/billing/deposit-address " , {
credentials : " include " ,
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/billing/deposit-address", {
credentials: "include",
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/billing/deposit-address " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Cookie " , " aikeys_session= " + os . Getenv ( " AIKEYS_SESSION " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/billing/deposit-address", nil)
if err != nil {
panic(err)
}
req.Header.Set("Cookie", "aikeys_session="+os.Getenv("AIKEYS_SESSION"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" chain " : " solana " ,
" mint " : " USDC " ,
" address " : " So1anaAddressExample "
} Billing
POST
/api/billing/deposits/check Ask the worker to inspect a Solana signature. A confirmed USDC transfer to this account’s address becomes paid and credits the consumer purse. One signature credits once.
API key https://aikeys.co
Field In Required Detail signature body yes Solana transaction signature.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X POST https://aikeys.co/api/billing/deposits/check \
-H " Authorization: Bearer $AIKEYS_CO_KEY " \
-H " Content-Type: application/json " \
-d ' {"signature":"5solanaSignature"} ' curl -X POST https://aikeys.co/api/billing/deposits/check \
-H "Authorization: Bearer $AIKEYS_CO_KEY" \
-H "Content-Type: application/json" \
-d '{"signature":"5solanaSignature"}' import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . post (
" https://aikeys.co/api/billing/deposits/check " ,
headers = { " Authorization " : f "Bearer { key } " },
json = { " signature " : " 5solanaSignature " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.post(
"https://aikeys.co/api/billing/deposits/check",
headers={"Authorization": f"Bearer {key}"},
json={"signature":"5solanaSignature"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/billing/deposits/check " , {
method : " POST " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " signature " : " 5solanaSignature " }),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/billing/deposits/check", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"signature":"5solanaSignature"}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
" os "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"signature":"5solanaSignature"} ` ))
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/billing/deposits/check " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
body := bytes.NewReader([]byte(`{"signature":"5solanaSignature"}`))
req, err := http.NewRequest("POST", "https://aikeys.co/api/billing/deposits/check", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" id " : " dep_01HZX " ,
" signature " : " 5solanaSignature " ,
" amount " : " 10.000000 " ,
" status " : " paid "
} Billing
GET
/api/billing/deposits List this account’s USDC deposit rows. Status is pending, paid, failed, or rejected.
API key https://aikeys.co
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl https://aikeys.co/api/billing/deposits \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl https://aikeys.co/api/billing/deposits \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . get (
" https://aikeys.co/api/billing/deposits " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.get(
"https://aikeys.co/api/billing/deposits",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/billing/deposits " , {
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/billing/deposits", {
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/billing/deposits " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/billing/deposits", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" deposits " : [
{
" id " : " dep_01HZX " ,
" signature " : " 5solanaSignature " ,
" amount " : " 10.000000 " ,
" status " : " paid " ,
" created_at " : " 2026-10-10T00:00:00Z "
}
]
} Settings
POST
/api/settings/password Change the password. Session only. Bumps session_version and keeps the current session.
Session cookie https://aikeys.co
Field In Required Detail current_password body yes Password in use. new_password body yes Replacement, at least 8 characters.
cURL Python TypeScript Go
Copy Browser session cookie aikeys_session. An API key cannot call this route.
curl -X POST https://aikeys.co/api/settings/password \
-c cookies.txt -b cookies.txt \
-H " Content-Type: application/json " \
-d ' {"current_password":"at-least-8","new_password":"another-8"} ' curl -X POST https://aikeys.co/api/settings/password \
-c cookies.txt -b cookies.txt \
-H "Content-Type: application/json" \
-d '{"current_password":"at-least-8","new_password":"another-8"}' import os
import requests
session = requests . Session ()
session . cookies . set ( " aikeys_session " , os . environ [ " AIKEYS_SESSION " ])
resp = session . post (
" https://aikeys.co/api/settings/password " ,
json = { " current_password " : " at-least-8 " , " new_password " : " another-8 " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
session = requests.Session()
session.cookies.set("aikeys_session", os.environ["AIKEYS_SESSION"])
resp = session.post(
"https://aikeys.co/api/settings/password",
json={"current_password":"at-least-8","new_password":"another-8"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/settings/password " , {
method : " POST " ,
headers : {
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " current_password " : " at-least-8 " , " new_password " : " another-8 " }),
credentials : " include " ,
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/settings/password", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"current_password":"at-least-8","new_password":"another-8"}),
credentials: "include",
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
" os "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"current_password":"at-least-8","new_password":"another-8"} ` ))
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/settings/password " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Cookie " , " aikeys_session= " + os . Getenv ( " AIKEYS_SESSION " ))
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
body := bytes.NewReader([]byte(`{"current_password":"at-least-8","new_password":"another-8"}`))
req, err := http.NewRequest("POST", "https://aikeys.co/api/settings/password", body)
if err != nil {
panic(err)
}
req.Header.Set("Cookie", "aikeys_session="+os.Getenv("AIKEYS_SESSION"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response Settings
GET
/api/settings/export Download this account’s JSON export. Session only.
Session cookie https://aikeys.co
cURL Python TypeScript Go
Copy Browser session cookie aikeys_session. An API key cannot call this route.
curl https://aikeys.co/api/settings/export \
-c cookies.txt -b cookies.txt curl https://aikeys.co/api/settings/export \
-c cookies.txt -b cookies.txt import os
import requests
session = requests . Session ()
session . cookies . set ( " aikeys_session " , os . environ [ " AIKEYS_SESSION " ])
resp = session . get (
" https://aikeys.co/api/settings/export " ,
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
session = requests.Session()
session.cookies.set("aikeys_session", os.environ["AIKEYS_SESSION"])
resp = session.get(
"https://aikeys.co/api/settings/export",
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/settings/export " , {
credentials : " include " ,
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/settings/export", {
credentials: "include",
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/settings/export " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Cookie " , " aikeys_session= " + os . Getenv ( " AIKEYS_SESSION " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/settings/export", nil)
if err != nil {
panic(err)
}
req.Header.Set("Cookie", "aikeys_session="+os.Getenv("AIKEYS_SESSION"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response Settings
DELETE
/api/settings/account Anonymize email and display name, set status to deleted, revoke keys, delete provider credentials, and bump session_version. Journals, payments, and request rows stay.
Session cookie https://aikeys.co
Field In Required Detail email body yes Must match the signed-in account.
cURL Python TypeScript Go
Copy Browser session cookie aikeys_session. An API key cannot call this route.
curl -X DELETE https://aikeys.co/api/settings/account \
-c cookies.txt -b cookies.txt \
-H " Content-Type: application/json " \
-d ' {"email":"[email protected] "} ' curl -X DELETE https://aikeys.co/api/settings/account \
-c cookies.txt -b cookies.txt \
-H "Content-Type: application/json" \
-d '{"email":"[email protected] "}' import os
import requests
session = requests . Session ()
session . cookies . set ( " aikeys_session " , os . environ [ " AIKEYS_SESSION " ])
resp = session . delete (
" https://aikeys.co/api/settings/account " ,
json = { " email " : " [email protected] " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
session = requests.Session()
session.cookies.set("aikeys_session", os.environ["AIKEYS_SESSION"])
resp = session.delete(
"https://aikeys.co/api/settings/account",
json={"email":"[email protected] "},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/settings/account " , {
method : " DELETE " ,
headers : {
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " email " : " [email protected] " }),
credentials : " include " ,
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/settings/account", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"email":"[email protected] "}),
credentials: "include",
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
" os "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"email":"[email protected] "} ` ))
req , err := http . NewRequest ( " DELETE " , " https://aikeys.co/api/settings/account " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Cookie " , " aikeys_session= " + os . Getenv ( " AIKEYS_SESSION " ))
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
body := bytes.NewReader([]byte(`{"email":"[email protected] "}`))
req, err := http.NewRequest("DELETE", "https://aikeys.co/api/settings/account", body)
if err != nil {
panic(err)
}
req.Header.Set("Cookie", "aikeys_session="+os.Getenv("AIKEYS_SESSION"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response Publisher
GET
/api/publisher/profile Read the publisher profile for this account.
API key https://aikeys.co
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl https://aikeys.co/api/publisher/profile \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl https://aikeys.co/api/publisher/profile \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . get (
" https://aikeys.co/api/publisher/profile " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.get(
"https://aikeys.co/api/publisher/profile",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/publisher/profile " , {
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/publisher/profile", {
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/publisher/profile " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/publisher/profile", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response { " name " : " Ada " , " description " : " Personal capacity " } Publisher
PUT
/api/publisher/profile Update the public publisher name and description.
API key https://aikeys.co
Field In Required Detail name body yes Display name on publisher surfaces. description body no Short note.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X PUT https://aikeys.co/api/publisher/profile \
-H " Authorization: Bearer $AIKEYS_CO_KEY " \
-H " Content-Type: application/json " \
-d ' {"name":"Ada","description":"Personal capacity"} ' curl -X PUT https://aikeys.co/api/publisher/profile \
-H "Authorization: Bearer $AIKEYS_CO_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Ada","description":"Personal capacity"}' import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . put (
" https://aikeys.co/api/publisher/profile " ,
headers = { " Authorization " : f "Bearer { key } " },
json = { " name " : " Ada " , " description " : " Personal capacity " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.put(
"https://aikeys.co/api/publisher/profile",
headers={"Authorization": f"Bearer {key}"},
json={"name":"Ada","description":"Personal capacity"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/publisher/profile " , {
method : " PUT " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " name " : " Ada " , " description " : " Personal capacity " }),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/publisher/profile", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"name":"Ada","description":"Personal capacity"}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
" os "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"name":"Ada","description":"Personal capacity"} ` ))
req , err := http . NewRequest ( " PUT " , " https://aikeys.co/api/publisher/profile " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
body := bytes.NewReader([]byte(`{"name":"Ada","description":"Personal capacity"}`))
req, err := http.NewRequest("PUT", "https://aikeys.co/api/publisher/profile", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response { " name " : " Ada " , " description " : " Personal capacity " } Publisher
GET
/api/publisher/providers List this account’s provider accounts, grouped by upstream, with quota and asks. Credentials are never returned.
API key https://aikeys.co
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl https://aikeys.co/api/publisher/providers \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl https://aikeys.co/api/publisher/providers \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . get (
" https://aikeys.co/api/publisher/providers " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.get(
"https://aikeys.co/api/publisher/providers",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/publisher/providers " , {
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/publisher/providers", {
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/publisher/providers " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/publisher/providers", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" providers " : [
{
" id " : " prv_01HZX " ,
" upstream_code " : " cc " ,
" label " : " personal " ,
" status " : " serving "
}
]
} Publisher
POST
/api/publisher/providers Add an upstream account. The credential is encrypted with AES-256-GCM before insert. An ask above half the official price is invalid_body.
API key https://aikeys.co
Field In Required Detail upstream_code body yes Catalog upstream code. label body yes Name for this account. credential body yes Upstream secret. Not returned later. asks body no Per-model ask_input and ask_output, decimal strings, at or below half official.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X POST https://aikeys.co/api/publisher/providers \
-H " Authorization: Bearer $AIKEYS_CO_KEY " \
-H " Content-Type: application/json " \
-d ' {"upstream_code":"cc","label":"personal","credential":{"api_key":"upstream-secret"},"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]} ' curl -X POST https://aikeys.co/api/publisher/providers \
-H "Authorization: Bearer $AIKEYS_CO_KEY" \
-H "Content-Type: application/json" \
-d '{"upstream_code":"cc","label":"personal","credential":{"api_key":"upstream-secret"},"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]}' import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . post (
" https://aikeys.co/api/publisher/providers " ,
headers = { " Authorization " : f "Bearer { key } " },
json = { " upstream_code " : " cc " , " label " : " personal " , " credential " :{ " api_key " : " upstream-secret " }, " asks " :[{ " model_id " : " cc/claude-opus-4-6 " , " ask_input " : " 1.5 " , " ask_output " : " 7.5 " }]},
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.post(
"https://aikeys.co/api/publisher/providers",
headers={"Authorization": f"Bearer {key}"},
json={"upstream_code":"cc","label":"personal","credential":{"api_key":"upstream-secret"},"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/publisher/providers " , {
method : " POST " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " upstream_code " : " cc " , " label " : " personal " , " credential " :{ " api_key " : " upstream-secret " }, " asks " :[{ " model_id " : " cc/claude-opus-4-6 " , " ask_input " : " 1.5 " , " ask_output " : " 7.5 " }]}),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/publisher/providers", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"upstream_code":"cc","label":"personal","credential":{"api_key":"upstream-secret"},"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
" os "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"upstream_code":"cc","label":"personal","credential":{"api_key":"upstream-secret"},"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]} ` ))
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/publisher/providers " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
body := bytes.NewReader([]byte(`{"upstream_code":"cc","label":"personal","credential":{"api_key":"upstream-secret"},"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]}`))
req, err := http.NewRequest("POST", "https://aikeys.co/api/publisher/providers", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response { " id " : " prv_01HZX " , " upstream_code " : " cc " , " label " : " personal " } Publisher
POST
/api/publisher/providers/{id}/recheck Enqueue a quota refresh for one provider account.
API key https://aikeys.co
Field In Required Detail id path yes Provider account public id.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X POST https://aikeys.co/api/publisher/providers/prv_01HZX/recheck \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl -X POST https://aikeys.co/api/publisher/providers/prv_01HZX/recheck \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . post (
" https://aikeys.co/api/publisher/providers/prv_01HZX/recheck " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.post(
"https://aikeys.co/api/publisher/providers/prv_01HZX/recheck",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/publisher/providers/prv_01HZX/recheck " , {
method : " POST " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/publisher/providers/prv_01HZX/recheck", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/publisher/providers/prv_01HZX/recheck " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", "https://aikeys.co/api/publisher/providers/prv_01HZX/recheck", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response { " id " : " prv_01HZX " , " queued " : true } Publisher
DELETE
/api/publisher/providers/{id} Soft-delete one provider account and delete its credential row.
API key https://aikeys.co
Field In Required Detail id path yes Provider account public id.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X DELETE https://aikeys.co/api/publisher/providers/prv_01HZX \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl -X DELETE https://aikeys.co/api/publisher/providers/prv_01HZX \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . delete (
" https://aikeys.co/api/publisher/providers/prv_01HZX " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.delete(
"https://aikeys.co/api/publisher/providers/prv_01HZX",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/publisher/providers/prv_01HZX " , {
method : " DELETE " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/publisher/providers/prv_01HZX", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " DELETE " , " https://aikeys.co/api/publisher/providers/prv_01HZX " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://aikeys.co/api/publisher/providers/prv_01HZX", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response { " id " : " prv_01HZX " , " deleted " : true } Publisher
DELETE
/api/publisher/providers?upstream={code} Soft-delete every provider account on one upstream for this user.
API key https://aikeys.co
Field In Required Detail upstream query yes Upstream code to clear.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X DELETE https://aikeys.co/api/publisher/providers?upstream=cc \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl -X DELETE https://aikeys.co/api/publisher/providers?upstream=cc \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . delete (
" https://aikeys.co/api/publisher/providers?upstream=cc " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.delete(
"https://aikeys.co/api/publisher/providers?upstream=cc",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/publisher/providers?upstream=cc " , {
method : " DELETE " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/publisher/providers?upstream=cc", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " DELETE " , " https://aikeys.co/api/publisher/providers?upstream=cc " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://aikeys.co/api/publisher/providers?upstream=cc", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response { " upstream " : " cc " , " deleted " : 1 } Publisher
PUT
/api/publisher/asks Write publisher asks. The worker copies them onto offers. An ask above half the official price is rejected.
API key https://aikeys.co
Field In Required Detail asks body yes model_id plus ask_input and ask_output decimal strings.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X PUT https://aikeys.co/api/publisher/asks \
-H " Authorization: Bearer $AIKEYS_CO_KEY " \
-H " Content-Type: application/json " \
-d ' {"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]} ' curl -X PUT https://aikeys.co/api/publisher/asks \
-H "Authorization: Bearer $AIKEYS_CO_KEY" \
-H "Content-Type: application/json" \
-d '{"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]}' import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . put (
" https://aikeys.co/api/publisher/asks " ,
headers = { " Authorization " : f "Bearer { key } " },
json = { " asks " :[{ " model_id " : " cc/claude-opus-4-6 " , " ask_input " : " 1.5 " , " ask_output " : " 7.5 " }]},
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.put(
"https://aikeys.co/api/publisher/asks",
headers={"Authorization": f"Bearer {key}"},
json={"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/publisher/asks " , {
method : " PUT " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
" Content-Type " : " application/json " ,
},
body : JSON . stringify ({ " asks " :[{ " model_id " : " cc/claude-opus-4-6 " , " ask_input " : " 1.5 " , " ask_output " : " 7.5 " }]}),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/publisher/asks", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
" os "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]} ` ))
req , err := http . NewRequest ( " PUT " , " https://aikeys.co/api/publisher/asks " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
body := bytes.NewReader([]byte(`{"asks":[{"model_id":"cc/claude-opus-4-6","ask_input":"1.5","ask_output":"7.5"}]}`))
req, err := http.NewRequest("PUT", "https://aikeys.co/api/publisher/asks", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response Publisher
GET
/api/publisher/earnings Available, held, and recent publisher_credit journals. Earnings stay on the platform in this version.
API key https://aikeys.co
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl https://aikeys.co/api/publisher/earnings \
-H " Authorization: Bearer $AIKEYS_CO_KEY " curl https://aikeys.co/api/publisher/earnings \
-H "Authorization: Bearer $AIKEYS_CO_KEY" import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . get (
" https://aikeys.co/api/publisher/earnings " ,
headers = { " Authorization " : f "Bearer { key } " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.get(
"https://aikeys.co/api/publisher/earnings",
headers={"Authorization": f"Bearer {key}"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/publisher/earnings " , {
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
},
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/publisher/earnings", {
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
},
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" fmt "
" net/http "
" os "
)
func main () {
req , err := http . NewRequest ( " GET " , " https://aikeys.co/api/publisher/earnings " , nil )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"fmt"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://aikeys.co/api/publisher/earnings", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" available " : " 3.200000000000 " ,
" held " : " 0.000000000000 " ,
" journals " : []
} Publisher
POST
/api/publisher/earnings/transfer Move available publisher funds to the consumer purse in one journal. Idempotent on the Idempotency-Key header.
API key https://aikeys.co
Field In Required Detail amount body yes Decimal string, not a float. Idempotency-Key header yes Same key returns the same journal. Do not reuse it for a different amount.
cURL Python TypeScript Go
Copy Send Authorization: Bearer or x-api-key. The samples use Bearer.
curl -X POST https://aikeys.co/api/publisher/earnings/transfer \
-H " Authorization: Bearer $AIKEYS_CO_KEY " \
-H " Idempotency-Key: transfer-01HZX " \
-H " Content-Type: application/json " \
-d ' {"amount":"1.00"} ' curl -X POST https://aikeys.co/api/publisher/earnings/transfer \
-H "Authorization: Bearer $AIKEYS_CO_KEY" \
-H "Idempotency-Key: transfer-01HZX" \
-H "Content-Type: application/json" \
-d '{"amount":"1.00"}' import os
import requests
key = os . environ [ " AIKEYS_CO_KEY " ]
resp = requests . post (
" https://aikeys.co/api/publisher/earnings/transfer " ,
headers = { " Authorization " : f "Bearer { key } " , " Idempotency-Key " : " transfer-01HZX " },
json = { " amount " : " 1.00 " },
)
resp . raise_for_status ()
print ( resp . json ()) import os
import requests
key = os.environ["AIKEYS_CO_KEY"]
resp = requests.post(
"https://aikeys.co/api/publisher/earnings/transfer",
headers={"Authorization": f"Bearer {key}", "Idempotency-Key": "transfer-01HZX"},
json={"amount":"1.00"},
)
resp.raise_for_status()
print(resp.json()) const resp = await fetch ( " https://aikeys.co/api/publisher/earnings/transfer " , {
method : " POST " ,
headers : {
Authorization : ` Bearer ${ process . env . AIKEYS_CO_KEY }` ,
" Content-Type " : " application/json " ,
" Idempotency-Key " : " transfer-01HZX " ,
},
body : JSON . stringify ({ " amount " : " 1.00 " }),
});
if ( ! resp . ok ) throw new Error ( await resp . text ());
console . log ( await resp . json ()); const resp = await fetch("https://aikeys.co/api/publisher/earnings/transfer", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIKEYS_CO_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "transfer-01HZX",
},
body: JSON.stringify({"amount":"1.00"}),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json()); package main
import (
" bytes "
" fmt "
" net/http "
" os "
)
func main () {
body := bytes . NewReader ([] byte ( ` {"amount":"1.00"} ` ))
req , err := http . NewRequest ( " POST " , " https://aikeys.co/api/publisher/earnings/transfer " , body )
if err != nil {
panic ( err )
}
req . Header . Set ( " Authorization " , " Bearer " + os . Getenv ( " AIKEYS_CO_KEY " ))
req . Header . Set ( " Content-Type " , " application/json " )
req . Header . Set ( " Idempotency-Key " , " transfer-01HZX " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
fmt . Println ( resp . Status )
} package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
body := bytes.NewReader([]byte(`{"amount":"1.00"}`))
req, err := http.NewRequest("POST", "https://aikeys.co/api/publisher/earnings/transfer", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AIKEYS_CO_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "transfer-01HZX")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
} Response {
" amount " : " 1.00 " ,
" consumer_available " : " 13.400000000000 " ,
" publisher_available " : " 2.200000000000 "
}