Skip to main content
POST
/
oauth
/
token
Exchange authorization code for access token
curl --request POST \
  --url https://console.gmicloud.ai/api/v1/oauth/token \
  --header 'Content-Type: application/json' \
  --data '{
  "provider": "github",
  "code": "abc123def456"
}'
{
  "accessToken": "ya29.a0AfH6SMB..."
}

Body

application/json

The request body for exchanging authorization code.

provider
enum<string>
required

The OAuth provider name.

  • "github": GitHub OAuth.
Available options:
github
Example:

"github"

code
string
required

The OAuth authorization code received from the OAuth callback.

Example:

"abc123def456"

Response

Successfully exchanged authorization code for access token.

accessToken
string
required

The OAuth access token that can be used to access the provider's API.

Example:

"ya29.a0AfH6SMB..."