Begin a device-code OAuth flow (e.g. OpenAI Codex)
curl --request POST \
--url https://auth.runtools.ai/v1/oauth/device/start/{provider} \
--header 'Authorization: Bearer <token>'import requests
url = "https://auth.runtools.ai/v1/oauth/device/start/{provider}"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://auth.runtools.ai/v1/oauth/device/start/{provider}', 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://auth.runtools.ai/v1/oauth/device/start/{provider}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://auth.runtools.ai/v1/oauth/device/start/{provider}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://auth.runtools.ai/v1/oauth/device/start/{provider}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://auth.runtools.ai/v1/oauth/device/start/{provider}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"provider": "<string>",
"authType": "device_code",
"attemptToken": "<string>",
"verificationUri": "<string>",
"verificationUriComplete": "<string>",
"userCode": "<string>",
"interval": 123,
"expiresAt": "2023-11-07T05:31:56Z"
}
}OAuth connections
Begin a device-code OAuth flow (e.g. OpenAI Codex)
POST
/
v1
/
oauth
/
device
/
start
/
{provider}
Begin a device-code OAuth flow (e.g. OpenAI Codex)
curl --request POST \
--url https://auth.runtools.ai/v1/oauth/device/start/{provider} \
--header 'Authorization: Bearer <token>'import requests
url = "https://auth.runtools.ai/v1/oauth/device/start/{provider}"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://auth.runtools.ai/v1/oauth/device/start/{provider}', 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://auth.runtools.ai/v1/oauth/device/start/{provider}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://auth.runtools.ai/v1/oauth/device/start/{provider}"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://auth.runtools.ai/v1/oauth/device/start/{provider}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://auth.runtools.ai/v1/oauth/device/start/{provider}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"provider": "<string>",
"authType": "device_code",
"attemptToken": "<string>",
"verificationUri": "<string>",
"verificationUriComplete": "<string>",
"userCode": "<string>",
"interval": 123,
"expiresAt": "2023-11-07T05:31:56Z"
}
}Authorizations
bearerapiKey
WorkOS session token or RunTools API key (rt_live_* / rt_test_*).
Used in Authorization: Bearer <token> header.
Path Parameters
Available options:
openai-codex Response
200 - application/json
Device flow started.
Show child attributes
Show child attributes
⌘I