> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# 获取用户订阅

GET https://api.elevenlabs.io/v1/user/subscription

获取用户订阅的扩展信息

Reference: https://elevenlabs.io/docs/api-reference/user/subscription/get

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Response

### 200

成功响应

- `tier` (string, required) — 用户订阅的套餐层级。
- `character_count` (integer, required) — 用户已使用的字符数。
- `character_limit` (integer, required) — 当前计费周期允许的最大字符数。
- `max_character_limit_extension` (integer, required, nullable) — 已弃用：请使用 `max_credit_limit_extension`。字符限额可超出的最大字符数。由工作区管理员管理。
- `max_credit_limit_extension` (ExtendedSubscriptionResponseModelMaxCreditLimitExtension, required) — 可超出积分限额的最大积分数。由工作区管理员管理。`"unlimited"` 表示无上限，`0` 表示禁用按用量计费。
- `can_extend_character_limit` (boolean, required) — 工作区是否有资格使用超额用量（按用量计费）。
- `allowed_to_extend_character_limit` (boolean, required) — 已弃用：请使用 `max_credit_limit_extension != 0`。用户是否可以扩展字符限额。
- `voice_slots_used` (integer, required) — 用户已使用的音色席位数。
- `professional_voice_slots_used` (integer, required) — 已使用的专业音色席位数。对于合并计费，此字段统计组内所有工作区；仅查看当前工作区请参阅 professional_voice_slots_used_in_workspace。
- `professional_voice_slots_used_in_workspace` (integer, required) — 当前工作区已使用的专业音色席位数。对于合并计费，professional_voice_slots_used 统计组内所有工作区，而此字段仅统计当前工作区。
- `voice_limit` (integer, required) — 用户允许拥有的最大音色槽位数。
- `voice_add_edit_counter` (integer, required) — 用户已使用的音色添加/编辑次数。
- `professional_voice_limit` (integer, required) — 用户允许拥有的最大专业音色数。
- `can_extend_voice_limit` (boolean, required) — 用户是否可扩展音色数量限制。
- `can_use_instant_voice_cloning` (boolean, required) — 用户是否可使用即时语音克隆。
- `can_use_professional_voice_cloning` (boolean, required) — 用户是否可使用专业语音克隆。
- `current_overage` (Price, required) — 当前按用量计费的超额费用。
- `status` (enum, required) — 用户订阅状态。
  - Allowed values: `trialing`, `active`, `incomplete`, `past_due`, `free`, `free_disabled`
- `open_invoices` (list of InvoiceResponseModel, required) — 用户未结清的发票。
- `has_open_invoices` (boolean, required) — 用户是否有未结清的发票。
- `next_character_count_reset_unix` (integer, optional, nullable) — 下次重置字符计数的 Unix 时间戳。
- `max_voice_add_edits` (integer, optional, nullable) — 用户允许添加或编辑音色的最大次数。
- `currency` (enum, optional, nullable) — 用户订阅的货币。
  - Allowed values: `usd`, `eur`, `inr`, `pln`, `gbp`
- `billing_period` (enum, optional, nullable) — 用户订阅的计费周期。
  - Allowed values: `monthly_period`, `3_month_period`, `6_month_period`, `annual_period`
- `character_refresh_period` (enum, optional, nullable) — 用户订阅的字符额度刷新周期。
  - Allowed values: `monthly_period`, `3_month_period`, `6_month_period`, `annual_period`
- `next_invoice` (InvoiceResponseModel, optional, nullable) — 用户的下一张发票。
- `pending_change` (ExtendedSubscriptionResponseModelPendingChange, optional, nullable) — 用户待处理的变更。
- `has_used_starter_coupon_on_account` (boolean, optional, default: false) — 如果该用户认证账户拥有的任一工作区已兑换入门版首月折扣券，则为 True。
- `has_used_creator_coupon_on_account` (boolean, optional, default: false) — 如果该用户认证账户拥有的任一工作区已兑换创作者首月折扣券，则为 True。
- `is_eligible_for_starter_promo` (boolean, optional, default: false) — 如果该用户的身份验证账户符合 Starter 首月优惠资格，则为 True；资格检查与结账时相同。是否提供该优惠仍由 starter_discount 功能标志决定。

## Errors

### 422 Unprocessable Entity Error

验证错误。

- `detail` (list of ValidationError, optional)

## Types

### ExtendedSubscriptionResponseModelMaxCreditLimitExtension

可超出积分限额的最大积分数。由工作区管理员管理。`"unlimited"` 表示无上限，`0` 表示禁用按用量计费。

- integer
- "unlimited"

### Price

货币/金额对。

- `amount` (string, required)
- `currency` (enum, required)
  - Allowed values: `usd`, `eur`, `inr`, `pln`, `gbp`

### InvoiceResponseModel

- `amount_due_cents` (integer, required) — 应付金额，单位为美分。
- `discounts` (list of DiscountResponseModel, required) — 应用于发票的折扣。
- `next_payment_attempt_unix` (integer, required) — 下次付款尝试的 Unix 时间戳。没有下次付款尝试时为 -1。
- `payment_intent_status` (enum, required, nullable) — 已弃用。请改用 [payment_intent_statusses]。此发票第一个支付意图的状态。没有支付意图时为 None。
  - Allowed values: `canceled`, `processing`, `requires_action`, `requires_capture`, `requires_confirmation`, `requires_payment_method`, `succeeded`
- `payment_intent_statusses` (list of enum, required) — 此发票付款意图的状态。没有付款意图时为空列表。
  - Allowed values: `canceled`, `processing`, `requires_action`, `requires_capture`, `requires_confirmation`, `requires_payment_method`, `succeeded`
- `subtotal_cents` (integer, optional, nullable) — 税前小计金额（以美分计，不含税费和折扣）。
- `tax_cents` (integer, optional, nullable) — 税额（以美分计）。
- `discount_percent_off` (double, optional, nullable) — 已弃用。请改用 [discounts]。应用于发票的折扣。例如，[20.0f] 表示 20% 折扣。
- `discount_amount_off` (double, optional, nullable) — 已弃用。请改用 [discounts]。应用于发票的折扣。例如，[20.0f] 表示减免 20 美分。

### ExtendedSubscriptionResponseModelPendingChange

用户待处理的变更。

- PendingSubscriptionSwitchResponseModel: PendingSubscriptionSwitchResponseModel
- PendingCancellationResponseModel: PendingCancellationResponseModel

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### DiscountResponseModel

- `discount_percent_off` (double, optional, nullable) — 应用于发票的折扣。例如，使用 [20.0f] 表示减免 20%。
- `discount_amount_off` (double, optional, nullable) — 应用于发票的折扣。例如，使用 [20.0f] 表示减免 20 美分。

### PendingSubscriptionSwitchResponseModel

- `next_tier` (enum, required) — 要更改到的套餐层级。
  - Allowed values: `free`, `starter`, `go`, `creator`, `pro`, `growing_business`, `scale_2024_08_10`, `grant_tier_1_2025_07_23`, `grant_tier_2_2025_07_23`, `grant`, `trial`, `enterprise`
- `next_billing_period` (enum, required) — 要更改为的计费周期。
  - Allowed values: `monthly_period`, `3_month_period`, `6_month_period`, `annual_period`
- `timestamp_seconds` (integer, required) — 变更时间戳。
- `kind` ("change", optional, default: change)

### PendingCancellationResponseModel

- `timestamp_seconds` (integer, required) — 取消时间戳。
- `kind` ("cancellation", optional, default: cancellation)

### ValidationErrorLocItems

- string
- integer

## Examples

**Response**

```json
{
  "tier": "starter",
  "character_count": 1000,
  "character_limit": 10000,
  "max_character_limit_extension": 10000,
  "max_credit_limit_extension": 10000,
  "can_extend_character_limit": true,
  "allowed_to_extend_character_limit": true,
  "voice_slots_used": 1,
  "professional_voice_slots_used": 0,
  "professional_voice_slots_used_in_workspace": 0,
  "voice_limit": 10,
  "voice_add_edit_counter": 0,
  "professional_voice_limit": 1,
  "can_extend_voice_limit": true,
  "can_use_instant_voice_cloning": true,
  "can_use_professional_voice_cloning": true,
  "current_overage": {
    "amount": "0",
    "currency": "usd"
  },
  "status": "active",
  "open_invoices": [
    {
      "amount_due_cents": 1000,
      "discounts": [
        {
          "discount_percent_off": 20
        }
      ],
      "next_payment_attempt_unix": 1738356858,
      "payment_intent_status": "processing",
      "payment_intent_statusses": [
        "processing",
        "succeeded"
      ],
      "subtotal_cents": 900,
      "tax_cents": 100
    }
  ],
  "has_open_invoices": true,
  "next_character_count_reset_unix": 1738356858,
  "currency": "usd",
  "billing_period": "monthly_period",
  "character_refresh_period": "monthly_period",
  "next_invoice": {
    "amount_due_cents": 1000,
    "discounts": [
      {
        "discount_percent_off": 20
      }
    ],
    "next_payment_attempt_unix": 1738356858,
    "payment_intent_status": "processing",
    "payment_intent_statusses": [
      "processing",
      "succeeded"
    ],
    "subtotal_cents": 900,
    "tax_cents": 100
  },
  "has_used_starter_coupon_on_account": false,
  "has_used_creator_coupon_on_account": false,
  "is_eligible_for_starter_promo": false
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/user/subscription"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/user/subscription';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.elevenlabs.io/v1/user/subscription"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/user/subscription")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.elevenlabs.io/v1/user/subscription")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/user/subscription');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/user/subscription");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/user/subscription")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```