Start MCP device authorization
curl --request POST \
--url https://api.paywithlocus.com/api/credits/mcp/oauth/device_authorization \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'client_id=<string>' \
--data 'resource=<string>' \
--data 'scope=mcp:read mcp:execute offline_access'import requests
url = "https://api.paywithlocus.com/api/credits/mcp/oauth/device_authorization"
payload = {
"client_id": "<string>",
"resource": "<string>",
"scope": "mcp:read mcp:execute offline_access"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
client_id: '<string>',
resource: '<string>',
scope: 'mcp:read mcp:execute offline_access'
})
};
fetch('https://api.paywithlocus.com/api/credits/mcp/oauth/device_authorization', 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.paywithlocus.com/api/credits/mcp/oauth/device_authorization",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "client_id=%3Cstring%3E&resource=%3Cstring%3E&scope=mcp%3Aread%20mcp%3Aexecute%20offline_access",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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.paywithlocus.com/api/credits/mcp/oauth/device_authorization"
payload := strings.NewReader("client_id=%3Cstring%3E&resource=%3Cstring%3E&scope=mcp%3Aread%20mcp%3Aexecute%20offline_access")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
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.paywithlocus.com/api/credits/mcp/oauth/device_authorization")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("client_id=%3Cstring%3E&resource=%3Cstring%3E&scope=mcp%3Aread%20mcp%3Aexecute%20offline_access")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/mcp/oauth/device_authorization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "client_id=%3Cstring%3E&resource=%3Cstring%3E&scope=mcp%3Aread%20mcp%3Aexecute%20offline_access"
response = http.request(request)
puts response.read_body{
"device_code": "<string>",
"user_code": "<string>",
"verification_uri": "<string>",
"verification_uri_complete": "<string>",
"expires_in": 900,
"interval": 5
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}MCP
Start MCP device authorization
RFC 8628 authorization for a headless public client registered with the device-code grant. Send the exact MCP resource. Locus returns a 15-minute device code, a human-readable user code, and a five-second initial polling interval. Do not send client authentication.
POST
/
credits
/
mcp
/
oauth
/
device_authorization
Start MCP device authorization
curl --request POST \
--url https://api.paywithlocus.com/api/credits/mcp/oauth/device_authorization \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'client_id=<string>' \
--data 'resource=<string>' \
--data 'scope=mcp:read mcp:execute offline_access'import requests
url = "https://api.paywithlocus.com/api/credits/mcp/oauth/device_authorization"
payload = {
"client_id": "<string>",
"resource": "<string>",
"scope": "mcp:read mcp:execute offline_access"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
client_id: '<string>',
resource: '<string>',
scope: 'mcp:read mcp:execute offline_access'
})
};
fetch('https://api.paywithlocus.com/api/credits/mcp/oauth/device_authorization', 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.paywithlocus.com/api/credits/mcp/oauth/device_authorization",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "client_id=%3Cstring%3E&resource=%3Cstring%3E&scope=mcp%3Aread%20mcp%3Aexecute%20offline_access",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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.paywithlocus.com/api/credits/mcp/oauth/device_authorization"
payload := strings.NewReader("client_id=%3Cstring%3E&resource=%3Cstring%3E&scope=mcp%3Aread%20mcp%3Aexecute%20offline_access")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
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.paywithlocus.com/api/credits/mcp/oauth/device_authorization")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("client_id=%3Cstring%3E&resource=%3Cstring%3E&scope=mcp%3Aread%20mcp%3Aexecute%20offline_access")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/mcp/oauth/device_authorization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "client_id=%3Cstring%3E&resource=%3Cstring%3E&scope=mcp%3Aread%20mcp%3Aexecute%20offline_access"
response = http.request(request)
puts response.read_body{
"device_code": "<string>",
"user_code": "<string>",
"verification_uri": "<string>",
"verification_uri_complete": "<string>",
"expires_in": 900,
"interval": 5
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}Body
application/x-www-form-urlencoded
Response
Pending device authorization
Secret device grant credential. Keep it only in the client that initiated the device flow and do not log it.
Pattern:
^lmo_dc_[A-Za-z0-9_-]{43}$Human-readable code that omits ambiguous characters. Display it exactly as returned.
Pattern:
^[A-HJ-NP-Z2-9]{4}-[A-HJ-NP-Z2-9]{4}$Initial minimum token-poll interval in seconds. A slow_down response increases it by five seconds, up to 60 seconds.