> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mitu.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mitu.ai/_mcp/server.

# Create a plan

POST https://api.mitu.ai/v1/subscription-plans
Content-Type: application/json

Create a subscription plan.

Reference: https://docs.mitu.ai/api-reference/subscriptions/create-subscription-plan

## Authentication

- `x-api-key` header (required) — Account API key used to authenticate server-side requests. Use the credentials issued for the same environment as the API base URL.

## Servers

- `https://api.mitu.ai` (Production, default)
- `https://sandbox-api.mitu.ai` (Sandbox)

## Request

### Headers

- `Idempotency-Key` (string, optional) — Unique key used to safely retry the same state-changing request.

### Body (application/json)

This endpoint expects a CreateSubscriptionPlan.

- `name` (string, required)
- `amount` (double, required)
- `currency` (string, required)
- `billing_interval` (enum, required)
  - Allowed values: `day`, `week`, `month`, `year`
- `description` (string, optional)
- `features` (list of string, optional)

## Response

### 201

Subscription plan created successfully.

- `message` (string, required)
- `data` (SubscriptionPlan, required)

## Errors

### 400 Bad Request Error

The request is invalid and could not be processed.

- `message` (string, required) — Human-readable description of the error.

### 401 Unauthorized Error

Authentication failed because the API key is missing or invalid.

- `message` (string, required) — Human-readable description of the error.

### 403 Forbidden Error

The authenticated account is not allowed to perform this action.

- `message` (string, required) — Human-readable description of the error.

### 422 Unprocessable Entity Error

One or more request fields are invalid.

- `message` (string, required)
- `errors` (list of ValidationErrorDetail, required)

### 429 Too Many Requests Error

Too many requests were sent in a short period.

- `message` (string, required) — Human-readable description of the error.

### 500 Internal Server Error

An unexpected error occurred while processing the request.

- `message` (string, required) — Human-readable description of the error.

## Types

### SubscriptionPlan

- `id` (string, optional)
- `name` (string, optional)
- `description` (string, optional, nullable)
- `amount` (string, optional)
- `currency` (string, optional)
- `billing_interval` (enum, optional)
  - Allowed values: `day`, `week`, `month`, `year`
- `features` (list of string, optional)
- `status` (enum, optional)
  - Allowed values: `active`, `paused`, `archived`
- `created_at` (datetime, optional)
- `updated_at` (datetime, optional)

### ValidationErrorDetail

- `field` (string, required) — Field that failed validation.
- `message` (string, required) — Description of the validation problem.

## Examples

**Request**

```json
{
  "name": "Pro",
  "amount": 49,
  "currency": "USD",
  "billing_interval": "month",
  "description": "For teams shipping agents in production",
  "features": [
    "Unlimited agents",
    "Priority support"
  ]
}
```

**Response**

```json
{
  "message": "Subscription plan retrieved successfully",
  "data": {
    "id": "plan_3j8w2q7xr1md",
    "name": "Pro",
    "description": "For teams shipping agents in production",
    "amount": "49.00",
    "currency": "USD",
    "billing_interval": "month",
    "features": [
      "Unlimited agents",
      "Priority support"
    ],
    "status": "active",
    "created_at": "2026-09-01T09:00:00.000Z",
    "updated_at": "2026-09-01T09:00:00.000Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.mitu.ai/v1/subscription-plans"

payload = {
    "name": "Pro",
    "amount": 49,
    "currency": "USD",
    "billing_interval": "month",
    "description": "For teams shipping agents in production",
    "features": ["Unlimited agents", "Priority support"]
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.mitu.ai/v1/subscription-plans';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"Pro","amount":49,"currency":"USD","billing_interval":"month","description":"For teams shipping agents in production","features":["Unlimited agents","Priority support"]}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.mitu.ai/v1/subscription-plans"

	payload := strings.NewReader("{\n  \"name\": \"Pro\",\n  \"amount\": 49,\n  \"currency\": \"USD\",\n  \"billing_interval\": \"month\",\n  \"description\": \"For teams shipping agents in production\",\n  \"features\": [\n    \"Unlimited agents\",\n    \"Priority support\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	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.mitu.ai/v1/subscription-plans")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Pro\",\n  \"amount\": 49,\n  \"currency\": \"USD\",\n  \"billing_interval\": \"month\",\n  \"description\": \"For teams shipping agents in production\",\n  \"features\": [\n    \"Unlimited agents\",\n    \"Priority support\"\n  ]\n}"

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.post("https://api.mitu.ai/v1/subscription-plans")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Pro\",\n  \"amount\": 49,\n  \"currency\": \"USD\",\n  \"billing_interval\": \"month\",\n  \"description\": \"For teams shipping agents in production\",\n  \"features\": [\n    \"Unlimited agents\",\n    \"Priority support\"\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.mitu.ai/v1/subscription-plans', [
  'body' => '{
  "name": "Pro",
  "amount": 49,
  "currency": "USD",
  "billing_interval": "month",
  "description": "For teams shipping agents in production",
  "features": [
    "Unlimited agents",
    "Priority support"
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.mitu.ai/v1/subscription-plans");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Pro\",\n  \"amount\": 49,\n  \"currency\": \"USD\",\n  \"billing_interval\": \"month\",\n  \"description\": \"For teams shipping agents in production\",\n  \"features\": [\n    \"Unlimited agents\",\n    \"Priority support\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Pro",
  "amount": 49,
  "currency": "USD",
  "billing_interval": "month",
  "description": "For teams shipping agents in production",
  "features": ["Unlimited agents", "Priority support"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.mitu.ai/v1/subscription-plans")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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