> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 (current TTS) and Pulse (current
> STT). Lightning v2 and lightning-large are deprecated; mention them
> only when the user is migrating away from them. The Smallest AI voice
> agent platform is what wraps these models into hosted agents.

# Get subscription and plan limits

GET https://api.smallest.ai/atoms/v1/user/subscription

Returns the organization's current subscription: plan id, credit balance,
renewal date, and the per-plan `limits` (agents, campaigns, numbers, daily and
concurrent calls, knowledge-base sizes) plus the `features` map that gates
capabilities like telephony, campaigns, and webhooks. Use it to check remaining
credits or whether a feature is enabled before attempting an action.


Reference: https://docs.smallest.ai/voice-agents/api-reference/user/get-subscription

## Authentication

- `Authorization` header (bearer token, required) — API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.

## Response

### 200

Successful response

- `status` (boolean, optional)
- `data` (object, optional) — The subscription record. Extra fields may be present.
  - `_id` (string, optional)
  - `organization` (string, optional)
  - `planId` (string, optional) — The active plan identifier.
  - `totalCredits` (double, optional)
  - `currentCredits` (double, optional) — Credits remaining in the current cycle.
  - `renewalDate` (datetime, optional)
  - `subscriptionActive` (boolean, optional)
  - `onPremEnabled` (boolean, optional)
  - `limits` (object, optional) — Per-plan quotas.
    - `agents` (integer, optional)
    - `campaigns` (integer, optional)
    - `numbers` (integer, optional)
    - `dailyCalls` (integer, optional)
    - `concurrentCalls` (integer, optional)
    - `knowledgeBaseItemLimit` (integer, optional)
    - `knowledgeBaseLimits` (integer, optional)
  - `features` (map from string to boolean, optional) — Feature flags gating capabilities for this plan.

## Examples

**Response**

```json
{
  "status": true,
  "data": {
    "_id": "string",
    "organization": "string",
    "planId": "string",
    "totalCredits": 1.1,
    "currentCredits": 1.1,
    "renewalDate": "2024-01-15T09:30:00Z",
    "subscriptionActive": true,
    "onPremEnabled": true,
    "limits": {
      "agents": 1,
      "campaigns": 1,
      "numbers": 1,
      "dailyCalls": 1,
      "concurrentCalls": 1,
      "knowledgeBaseItemLimit": 1,
      "knowledgeBaseLimits": 1
    },
    "features": {}
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.smallest.ai/atoms/v1/user/subscription"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.smallest.ai/atoms/v1/user/subscription';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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.smallest.ai/atoms/v1/user/subscription"

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

	req.Header.Add("Authorization", "Bearer <token>")

	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.smallest.ai/atoms/v1/user/subscription")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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.smallest.ai/atoms/v1/user/subscription")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.smallest.ai/atoms/v1/user/subscription', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.smallest.ai/atoms/v1/user/subscription");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

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

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()
```