Create an auth token via OAuth.
curl --request POST \
--url https://console.gmicloud.ai/api/v1/me/oauth/auth-tokens \
--header 'Content-Type: application/json' \
--data '
{
"provider": "google",
"accessToken": "ya29.a0AfH6SMB..."
}
'import requests
url = "https://console.gmicloud.ai/api/v1/me/oauth/auth-tokens"
payload = {
"provider": "google",
"accessToken": "ya29.a0AfH6SMB..."
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({provider: 'google', accessToken: 'ya29.a0AfH6SMB...'})
};
fetch('https://console.gmicloud.ai/api/v1/me/oauth/auth-tokens', 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://console.gmicloud.ai/api/v1/me/oauth/auth-tokens",
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([
'provider' => 'google',
'accessToken' => 'ya29.a0AfH6SMB...'
]),
CURLOPT_HTTPHEADER => [
"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://console.gmicloud.ai/api/v1/me/oauth/auth-tokens"
payload := strings.NewReader("{\n \"provider\": \"google\",\n \"accessToken\": \"ya29.a0AfH6SMB...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://console.gmicloud.ai/api/v1/me/oauth/auth-tokens")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"google\",\n \"accessToken\": \"ya29.a0AfH6SMB...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.gmicloud.ai/api/v1/me/oauth/auth-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider\": \"google\",\n \"accessToken\": \"ya29.a0AfH6SMB...\"\n}"
response = http.request(request)
puts response.read_body{
"authToken": "eyJhbGciOiJIUzI1NiIsInR..."
}me
Create an auth token via OAuth.
Create a short-term authentication token using a third-party OAuth provider (e.g., Google).
POST
/
me
/
oauth
/
auth-tokens
Create an auth token via OAuth.
curl --request POST \
--url https://console.gmicloud.ai/api/v1/me/oauth/auth-tokens \
--header 'Content-Type: application/json' \
--data '
{
"provider": "google",
"accessToken": "ya29.a0AfH6SMB..."
}
'import requests
url = "https://console.gmicloud.ai/api/v1/me/oauth/auth-tokens"
payload = {
"provider": "google",
"accessToken": "ya29.a0AfH6SMB..."
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({provider: 'google', accessToken: 'ya29.a0AfH6SMB...'})
};
fetch('https://console.gmicloud.ai/api/v1/me/oauth/auth-tokens', 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://console.gmicloud.ai/api/v1/me/oauth/auth-tokens",
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([
'provider' => 'google',
'accessToken' => 'ya29.a0AfH6SMB...'
]),
CURLOPT_HTTPHEADER => [
"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://console.gmicloud.ai/api/v1/me/oauth/auth-tokens"
payload := strings.NewReader("{\n \"provider\": \"google\",\n \"accessToken\": \"ya29.a0AfH6SMB...\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://console.gmicloud.ai/api/v1/me/oauth/auth-tokens")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"google\",\n \"accessToken\": \"ya29.a0AfH6SMB...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.gmicloud.ai/api/v1/me/oauth/auth-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"provider\": \"google\",\n \"accessToken\": \"ya29.a0AfH6SMB...\"\n}"
response = http.request(request)
puts response.read_body{
"authToken": "eyJhbGciOiJIUzI1NiIsInR..."
}Body
application/json
The request body for creating an auth token via OAuth.
The authentication provider used for login.
- "google": User logs in with Google OAuth.
- "github": User logs in with Github OAuth.
- "hugging_face": User logs in with Hugging Face OAuth.
Available options:
google, github, hugging_face Example:
"google"
OAuth access token (e.g., Google).
Example:
"ya29.a0AfH6SMB..."
Response
Successfully created an auth token for user via OAuth.
A temporary token issued after the initial login step. This token is used in the create session API to exchange for access and refresh tokens.
Example:
"eyJhbGciOiJIUzI1NiIsInR..."
⌘I