Me
Returns the account view for the current credential.
- Manual API key: returns the full manual-key account view
- OAuth token: returns a scope-cropped response
Endpoint
http
GET https://api.sakrylle.com/v1/meHeaders
| Name | Required | Description |
|---|---|---|
Authorization | Yes | Bearer sk-xxxxxxxxxxxxxxxx or Bearer sk_oauth_xxxxxxxxxxxxxxxx |
Core fields
| Field | Type | Description |
|---|---|---|
auth_type | string | api_key or oauth |
user | object | User profile block |
account | object | Wallet / display-currency block |
current_group | object | Current group |
allowed_groups | array | Returned only for OAuth account:read |
granted_scopes | array | Returned only for OAuth |
effective_capabilities | object | Returned only for OAuth; the intersection of granted scopes and current group capability |
user
| Field | Description |
|---|---|
user.id | User ID |
user.username | Username |
user.display_name | Display name |
user.avatar_url | Avatar URL, may be null |
user.locale | Current locale |
user.email | Returned only with the relevant scope |
account
| Field | Description |
|---|---|
account.credit_remaining | Current balance |
account.currency_display | Display currency, always CNY |
account.currency_symbol | Display symbol, always ¥ |
Group fields
| Field | Description |
|---|---|
id | Numeric group ID |
name | Group name |
rate_multiplier | Current group multiplier |
allow_image_generation | Whether image-generation-related capability is allowed |
is_default | Returned only in allowed_groups[]; marks the default group |
Scope cropping
| Scope | Returned content |
|---|---|
profile:read | user |
account:balance:read | account |
account:read | account, current_group, allowed_groups, granted_scopes, effective_capabilities |
Additional notes:
- OAuth responses always include
auth_type - OAuth responses include
granted_scopesandeffective_capabilities - If the request has
openid, top-level OIDC fields such assubmay also appear
Manual API key example
json
{
"auth_type": "api_key",
"user": {
"id": 42,
"username": "alice",
"display_name": "alice",
"avatar_url": null,
"locale": "zh-CN"
},
"account": {
"credit_remaining": 23.71,
"currency_display": "CNY",
"currency_symbol": "¥"
},
"current_group": {
"id": 3,
"name": "GPT-Pro",
"rate_multiplier": 0.5,
"allow_image_generation": true
}
}OAuth example
json
{
"auth_type": "oauth",
"user": {
"id": 42,
"username": "alice",
"display_name": "alice",
"avatar_url": null,
"locale": "zh-CN"
},
"account": {
"credit_remaining": 23.71,
"currency_display": "CNY",
"currency_symbol": "¥"
},
"current_group": {
"id": 3,
"name": "GPT-Pro",
"rate_multiplier": 0.5,
"allow_image_generation": true
},
"allowed_groups": [
{
"id": 3,
"name": "GPT-Pro",
"rate_multiplier": 0.5,
"allow_image_generation": true,
"is_default": true
},
{
"id": 5,
"name": "GPT-Image",
"rate_multiplier": 1,
"allow_image_generation": true,
"is_default": false
}
],
"granted_scopes": [
"profile:read",
"account:read",
"account:balance:read"
],
"effective_capabilities": {
"profile_read": true,
"email_read": false,
"account_read": true,
"account_balance_read": true,
"models_read": false,
"chat_completions_create": false,
"responses_create": false,
"messages_create": false,
"images_create": false,
"usage_read": false,
"offline_access": false
}
}Notes
- Manual API keys are not scope-cropped
- OAuth tokens need at least one of
profile:read,account:read, oraccount:balance:readto access this endpoint effective_capabilities.images_createdepends on both scope and group capability; scope alone does not guaranteetrue
Errors
401 authentication_error— authentication failed403 insufficient_scope/permission_error— missing OAuth scope or access denied
Code samples
bash
curl https://api.sakrylle.com/v1/me \
-H "Authorization: Bearer $SAKRYLLE_API_KEY"python
import httpx
resp = httpx.get(
"https://api.sakrylle.com/v1/me",
headers={"Authorization": "Bearer sk-xxxxxxxxxxxxxxxx"},
)
print(resp.json())javascript
const resp = await fetch("https://api.sakrylle.com/v1/me", {
headers: { Authorization: "Bearer sk-xxxxxxxxxxxxxxxx" },
});
console.log(await resp.json());go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET",
"https://api.sakrylle.com/v1/me", nil)
req.Header.Set("Authorization", "Bearer sk-xxxxxxxxxxxxxxxx")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
}rust
use reqwest::Client;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let client = Client::new();
let resp: serde_json::Value = client
.get("https://api.sakrylle.com/v1/me")
.bearer_auth("sk-xxxxxxxxxxxxxxxx")
.send()
.await?
.json()
.await?;
println!("{resp:#}");
Ok(())
}java
import java.net.URI;
import java.net.http.*;
public class Me {
public static void main(String[] args) throws Exception {
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.sakrylle.com/v1/me"))
.header("Authorization", "Bearer sk-xxxxxxxxxxxxxxxx")
.GET()
.build();
HttpResponse<String> resp = HttpClient.newHttpClient()
.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(resp.body());
}
}csharp
using System.Net.Http.Headers;
var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "sk-xxxxxxxxxxxxxxxx");
var resp = await http.GetAsync("https://api.sakrylle.com/v1/me");
Console.WriteLine(await resp.Content.ReadAsStringAsync());