Connect an Anthropic subscription
curl --request POST \
--url https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"access_token": "<string>",
"refresh_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"account_key": "<string>"
}
'import requests
url = "https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic"
payload = {
"access_token": "<string>",
"refresh_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"account_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
access_token: '<string>',
refresh_token: '<string>',
expires_at: '2023-11-07T05:31:56Z',
account_key: '<string>'
})
};
fetch('https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic', 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.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic",
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([
'access_token' => '<string>',
'refresh_token' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z',
'account_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic"
payload := strings.NewReader("{\n \"access_token\": \"<string>\",\n \"refresh_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"account_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"access_token\": \"<string>\",\n \"refresh_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"account_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic")
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 \"access_token\": \"<string>\",\n \"refresh_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"account_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"provider_id": "anthropic",
"account_key": "<string>",
"connected": true,
"credential_type": "oauth"
}{
"error": "prompt_required"
}{
"error": "unauthorized"
}{
"error": "missing_scope",
"required_scope": "sessions:read"
}Provider credentials
Connect an Anthropic subscription
Stores an Anthropic OAuth credential obtained locally by Ara CLI. Requires a workspace-bound Ara user OAuth grant and owner or admin membership. Token values are write-only and never returned.
Scope:org:writePOST
/
v3
/
organizations
/
{orgId}
/
provider-credentials
/
anthropic
Connect an Anthropic subscription
curl --request POST \
--url https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"access_token": "<string>",
"refresh_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"account_key": "<string>"
}
'import requests
url = "https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic"
payload = {
"access_token": "<string>",
"refresh_token": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"account_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
access_token: '<string>',
refresh_token: '<string>',
expires_at: '2023-11-07T05:31:56Z',
account_key: '<string>'
})
};
fetch('https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic', 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.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic",
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([
'access_token' => '<string>',
'refresh_token' => '<string>',
'expires_at' => '2023-11-07T05:31:56Z',
'account_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic"
payload := strings.NewReader("{\n \"access_token\": \"<string>\",\n \"refresh_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"account_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"access_token\": \"<string>\",\n \"refresh_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"account_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reasonmachines.ai/v3/organizations/{orgId}/provider-credentials/anthropic")
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 \"access_token\": \"<string>\",\n \"refresh_token\": \"<string>\",\n \"expires_at\": \"2023-11-07T05:31:56Z\",\n \"account_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"provider_id": "anthropic",
"account_key": "<string>",
"connected": true,
"credential_type": "oauth"
}{
"error": "prompt_required"
}{
"error": "unauthorized"
}{
"error": "missing_scope",
"required_scope": "sessions:read"
}Authorizations
A workspace-bound human user OAuth grant with org:write scope. The user must be an organization owner/admin. API keys and browser sessions are not accepted.
Path Parameters
Organization id or slug. Resolve it with GET /v3/self.
Body
application/json
Anthropic OAuth access token. Write-only; never returned.
Maximum string length:
8192Anthropic OAuth refresh token. Write-only; never returned.
Maximum string length:
8192Existing Anthropic account slot to reconnect.
Required string length:
1 - 512
