Connectors
Create an API-key connector
Create a connector from a user-provided API key for providers that support key validation.
POST
/
v1
/
oauth
/
connections
/
api_key
Create an API-key connector
curl --request POST \
--url https://api.sprites.dev/v1/oauth/connections/api_key \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "sk-or-...",
"provider": "openrouter",
"access_policy": {
"allow_all": true
},
"base_api_url": "https://your-database.upstash.io"
}
'import requests
url = "https://api.sprites.dev/v1/oauth/connections/api_key"
payload = {
"api_key": "sk-or-...",
"provider": "openrouter",
"access_policy": { "allow_all": True },
"base_api_url": "https://your-database.upstash.io"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_key: 'sk-or-...',
provider: 'openrouter',
access_policy: {allow_all: true},
base_api_url: 'https://your-database.upstash.io'
})
};
fetch('https://api.sprites.dev/v1/oauth/connections/api_key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sprites.dev/v1/oauth/connections/api_key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => 'sk-or-...',
'provider' => 'openrouter',
'access_policy' => [
'allow_all' => true
],
'base_api_url' => 'https://your-database.upstash.io'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sprites.dev/v1/oauth/connections/api_key"
payload := strings.NewReader("{\n \"api_key\": \"sk-or-...\",\n \"provider\": \"openrouter\",\n \"access_policy\": {\n \"allow_all\": true\n },\n \"base_api_url\": \"https://your-database.upstash.io\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sprites.dev/v1/oauth/connections/api_key")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"sk-or-...\",\n \"provider\": \"openrouter\",\n \"access_policy\": {\n \"allow_all\": true\n },\n \"base_api_url\": \"https://your-database.upstash.io\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sprites.dev/v1/oauth/connections/api_key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"sk-or-...\",\n \"provider\": \"openrouter\",\n \"access_policy\": {\n \"allow_all\": true\n },\n \"base_api_url\": \"https://your-database.upstash.io\"\n}"
response = http.request(request)
puts response.read_body{
"connection": {
"id": "conn_abc123",
"provider": "slack"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
API-key connector request
Provider API key. Stored encrypted and never returned by the API.
Example:
"sk-or-..."
API-key provider.
Example:
"openrouter"
Initial access policy. Empty or missing policies deny sprite use until updated.
Show child attributes
Show child attributes
Example:
{ "allow_all": true }
Required for Upstash Redis: immutable HTTPS database REST URL. Not used by fixed-host providers.
Example:
"https://your-database.upstash.io"
Response
Created
Connector response
Sanitized connector. Secrets and encrypted token fields are never returned.
Show child attributes
Show child attributes
Example:
{ "id": "conn_abc123", "provider": "slack" }
⌘I
Create an API-key connector
curl --request POST \
--url https://api.sprites.dev/v1/oauth/connections/api_key \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "sk-or-...",
"provider": "openrouter",
"access_policy": {
"allow_all": true
},
"base_api_url": "https://your-database.upstash.io"
}
'import requests
url = "https://api.sprites.dev/v1/oauth/connections/api_key"
payload = {
"api_key": "sk-or-...",
"provider": "openrouter",
"access_policy": { "allow_all": True },
"base_api_url": "https://your-database.upstash.io"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
api_key: 'sk-or-...',
provider: 'openrouter',
access_policy: {allow_all: true},
base_api_url: 'https://your-database.upstash.io'
})
};
fetch('https://api.sprites.dev/v1/oauth/connections/api_key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sprites.dev/v1/oauth/connections/api_key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => 'sk-or-...',
'provider' => 'openrouter',
'access_policy' => [
'allow_all' => true
],
'base_api_url' => 'https://your-database.upstash.io'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sprites.dev/v1/oauth/connections/api_key"
payload := strings.NewReader("{\n \"api_key\": \"sk-or-...\",\n \"provider\": \"openrouter\",\n \"access_policy\": {\n \"allow_all\": true\n },\n \"base_api_url\": \"https://your-database.upstash.io\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sprites.dev/v1/oauth/connections/api_key")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"sk-or-...\",\n \"provider\": \"openrouter\",\n \"access_policy\": {\n \"allow_all\": true\n },\n \"base_api_url\": \"https://your-database.upstash.io\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sprites.dev/v1/oauth/connections/api_key")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"sk-or-...\",\n \"provider\": \"openrouter\",\n \"access_policy\": {\n \"allow_all\": true\n },\n \"base_api_url\": \"https://your-database.upstash.io\"\n}"
response = http.request(request)
puts response.read_body{
"connection": {
"id": "conn_abc123",
"provider": "slack"
}
}