> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.voicecheap.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 認可サーバーのメタデータを取得

> この環境が対応する公開OAuthエンドポイントと、認可コード、PKCE、リフレッシュ、失効の仕組みを確認します。

この環境が対応する公開OAuthエンドポイントと、認可コード、PKCE、リフレッシュ、失効の仕組みを確認します。

```http theme={null}
GET https://api.voicecheap.ai/.well-known/oauth-authorization-server
```

## 認証

なし。

## リクエスト例

このルートに記載されたエンコード方式と認証方法に従ってください。アクション API のエンベロープと冪等性のルールは、アクションの呼び出しにのみ適用されます。

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET 'https://api.voicecheap.ai/.well-known/oauth-authorization-server'
  ```

  ```javascript JavaScript theme={null}
  const input = {};
  const response = await fetch('https://api.voicecheap.ai/.well-known/oauth-authorization-server', {
    method: 'GET',
    headers: {},
    redirect: 'manual',
  });
  console.log(response.status, await response.text());
  ```

  ```python Python theme={null}
  import os
  import requests

  response = requests.request(
      "GET",
      "https://api.voicecheap.ai/.well-known/oauth-authorization-server",
      headers={},
      timeout=120,
      allow_redirects=False,
  )
  print(response.status_code, response.text)
  ```
</RequestExample>

## レスポンス

正規の issuer オリジンにある絶対エンドポイント URL を含む、OAuth 認可サーバーのメタデータ。

```json HTTP 200 theme={null}
{
  "issuer": "https://api.voicecheap.ai",
  "authorization_endpoint": "https://api.voicecheap.ai/oauth/authorize",
  "token_endpoint": "https://api.voicecheap.ai/oauth/token",
  "registration_endpoint": "https://api.voicecheap.ai/oauth/register",
  "revocation_endpoint": "https://api.voicecheap.ai/oauth/revoke",
  "response_types_supported": ["code"],
  "response_modes_supported": ["query"],
  "grant_types_supported": ["authorization_code", "refresh_token"],
  "token_endpoint_auth_methods_supported": ["none"],
  "revocation_endpoint_auth_methods_supported": ["none"],
  "code_challenge_methods_supported": ["S256"],
  "scopes_supported": [
    "account:read",
    "usage:read",
    "settings:read",
    "settings:write",
    "team:read",
    "team:write",
    "projects:read",
    "projects:write",
    "projects:delete",
    "translations:write",
    "transcription:read",
    "transcription:write",
    "subtitles:read",
    "subtitles:write",
    "tts:read",
    "tts:write",
    "voices:read",
    "voices:write",
    "images:read",
    "images:write",
    "thumbnails:read",
    "thumbnails:write",
    "folders:read",
    "folders:write",
    "glossary:read",
    "glossary:write",
    "webhooks:read",
    "webhooks:write",
    "publishing:read",
    "publishing:write",
    "offline_access"
  ],
  "authorization_response_iss_parameter_supported": true,
  "client_id_metadata_document_supported": true
}
```

## 操作の注意事項

* 対応として公開されるのは、レスポンスタイプ code とレスポンスモード query のみです。
* クライアントは動的登録または Client ID Metadata Document（CIMD）を使用できます。client\_id\_metadata\_document\_supported は true です。CIMD クライアントはドキュメントの公開 HTTPS URL を client\_id として使用します。
* CIMD の JSON ドキュメントには、完全一致する client\_id、空でない最大 120 文字の client\_name、1～10 件の正確な redirect\_uris が必要です。公開クライアント認証 none と S256 PKCE を使用してください。authorization\_code は必須、refresh\_token は任意です。
* CIMD はポート 443 の公開 HTTPS で非圧縮 JSON として配信し、明示的なパスを指定してください。認証情報、フラグメント、ドットセグメント、リダイレクトは使用できません。ドキュメントは最大 64 KiB で、5 秒以内に応答する必要があります。キャッシュは最大 5 分で失効します。トークン交換と更新には認可に紐づいたメタデータが使われます。
* OpenID Connect が利用可能な場合、認可サーバーのメタデータには openid と email スコープ、userinfo\_endpoint、jwks\_uri も含まれます。利用できない場合、これらのスコープとエンドポイントはメタデータに含まれません。
* トークンと失効処理の認証方式は none です。パブリッククライアントは、クライアントシークレットの代わりに client\_id と S256 PKCE を使用します。
* offline\_access は更新関連のスコープマーカーであり、プロダクト権限ではありません。リフレッシュトークンが発行されるかは、認可方式として refresh\_token を登録したかどうかで決まります。
* 最終的なクライアントコールバックで返された iss の値を issuer と照合してください。認可の成功・拒否のどちらのコールバックにも iss が含まれ、state が指定されていた場合はその値も返します。

## エラー

| HTTP ステータス | コード | 意味または対処方法 |
| - | - | - |
| 429 | `temporarily_unavailable` | 公開 OAuth リクエストのレート上限に達しました。現在の制限期間が終わってから再試行してください。 |
| 500 | `server_error` | 認可を一時的に利用できません。後で再試行してください。 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.