📋 API概要
AI Toolsサービス用のRESTful APIシステムです。ユーザー管理とデータ操作を提供する、マルチテナント対応のマネージドAPIサービスです。
🔐 セキュリティ
Bearer Token認証とIP制限による強固なセキュリティ
📊 プラン管理
柔軟なプラン設定と利用制限管理
ベースURL
https://api.ai-tools.city/
🔐 認証
Bearer Token認証
全てのAPIリクエストには、Authorizationヘッダーにトークンが必要です。
認証ヘッダー
Authorization: Bearer YOUR_TOKEN_HERE
セキュリティ機能
- トリプル暗号化: AES-256-CBCによる3段階暗号化
- IP制限: 許可されたIPアドレスからのみアクセス可能
- アクセスログ: 全API呼び出しをログに記録
👥 Accounts API
ユーザーアカウントの管理を行うAPIエンドポイント群です。
GET
/accounts/
ユーザー一覧取得
全ユーザーのID、メールアドレス一覧を取得します。
cURLコマンド:
curl -X GET "https://api.ai-tools.city/accounts/" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json"
レスポンス例:
{
"status": "success",
"result": [
{
"id": 1,
"username": "user@example.com"
}
],
"request_id": 12345
}
GET
/accounts/{userid}
ユーザー詳細取得
指定ユーザーの詳細情報を取得します。
cURLコマンド:
curl -X GET "https://api.ai-tools.city/accounts/1" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json"
レスポンス例:
{
"status": "success",
"result": {
"id": 1,
"username": "user@example.com",
"status": "active",
"plan": "basic1",
"article_limit": 10,
"word_limit": 125000,
"image_limit": 10,
"research_dr": 50,
"research_sg": 100,
"research_kw": 75,
"research_bl": 25,
"keyword_limit": 10,
"start_datetime": "2024-01-15 10:30:00"
},
"request_id": 12346
}
フィールド説明:
• research_dr: 競合サイト獲得キーワード調査の残り回数
• research_sg: サジェストキーワードの残り回数
• research_kw: キーワード難易度調査の残り回数
• research_bl: 被リンクドメイン調査の残り回数
• keyword_limit: キーワード発掘の残り回数
GET
/accounts/{userid}/sso
SSO URL生成
シングルサインオン用の暗号化URLを生成します。
cURLコマンド:
curl -X GET "https://api.ai-tools.city/accounts/1/sso" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json"
レスポンス例:
{
"status": "success",
"result": "https://cp.value-aiwriter.com/sso.php?p=ENCRYPTED_TOKEN",
"request_id": 12347
}
GET
/accounts/{userid}/history
利用履歴取得
過去2ヶ月間のGPT利用ログを取得します。
cURLコマンド:
curl -X GET "https://api.ai-tools.city/accounts/1/history" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json"
POST
/accounts/
ユーザー作成
新規ユーザーを作成します。
cURLコマンド:
curl -X POST "https://api.ai-tools.city/accounts/" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"username": "newuser@example.com",
"password": "securepassword123",
"plan": "basic1"
}'
リクエストボディ例:
{
"username": "newuser@example.com",
"password": "securepassword123",
"plan": "basic1"
}
PUT
/accounts/{userid}
ユーザー情報更新
ユーザーのプラン、ステータス、制限値を更新します。
cURLコマンド:
curl -X PUT "https://api.ai-tools.city/accounts/1" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"plan": "basic3",
"status": "active",
"article_limit": 100,
"word_limit": 50000,
"image_limit": 50,
"research_dr": 100,
"research_sg": 200,
"research_kw": 150,
"research_bl": 50,
"keyword_limit": 20
}'
リクエストボディ例:
{
"plan": "basic3",
"status": "active",
"article_limit": 100,
"word_limit": 50000,
"image_limit": 50,
"research_dr": 100,
"research_sg": 200,
"research_kw": 150,
"research_bl": 50,
"keyword_limit": 20
}
更新可能フィールド:
• plan: プラン名 (basic1, basic3, basic5, premium, pro)
• status: ユーザーステータス (active, suspended, deleted)
• article_limit: 記事数制限
• word_limit: 文字数制限
• image_limit: 画像数制限
• research_dr: 競合サイト獲得キーワード調査制限
• research_sg: サジェストキーワード制限
• research_kw: キーワード難易度調査制限
• research_bl: 被リンクドメイン調査制限
• keyword_limit: キーワード発掘制限
レスポンス例:
{
"status": "success",
"result": {
"id": 1,
"username": "user@example.com",
"status": "active",
"plan": "basic3",
"article_limit": 100,
"word_limit": 50000,
"image_limit": 50,
"research_dr": 100,
"research_sg": 200,
"research_kw": 150,
"research_bl": 50,
"keyword_limit": 20,
"start_datetime": "2024-01-15 10:30:00"
},
"request_id": 12348
}
DELETE
/accounts/{userid}
ユーザー削除
指定したユーザーを削除します。
cURLコマンド:
curl -X DELETE "https://api.ai-tools.city/accounts/1" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json"
💼 プラン一覧
利用可能なプランとその制限値です。
プラン
| プラン名 | 記事数 | 文字数 | 画像数 | 競合調査 | サジェスト | 難易度調査 | 被リンク調査 | キーワード発掘 |
|---|---|---|---|---|---|---|---|---|
| basic1 | 1 | 125,000 | 1 | 0 | 0 | 0 | 0 | 1 |
| basic3 | 3 | 75,000 | 3 | 0 | 0 | 2 | 0 | 3 |
| basic5 | 5 | 125,000 | 5 | 0 | 0 | 5 | 0 | 5 |
| basic10 | 11 | 270,000 | 11 | 0 | 0 | 12 | 0 | 11 |
| basic20 | 20 | 600,000 | 11 | 0 | 0 | 25 | 0 | 11 |
| basic40 | 50 | 1,500,000 | 50 | 0 | 20 | 50 | 0 | 50 |
| pro100 | 100 | 3,000,000 | 100 | 10 | 100 | 400 | 50 | 100 |
| pro200 | 300 | 10,000,000 | 300 | 10 | 100 | 400 | 50 | 200 |
制限値フィールド説明
• 競合調査 (research_dr): 競合サイト獲得キーワード調査
• サジェスト (research_sg): サジェストキーワード
• 難易度調査 (research_kw): キーワード難易度調査
• 被リンク調査 (research_bl): 被リンクドメイン調査
• キーワード発掘 (keyword_limit): キーワード発掘
⚠️ エラーレスポンス
成功レスポンス
{
"status": "success",
"result": { /* レスポンスデータ */ },
"request_id": 12345
}
エラーレスポンス
{
"status": "error",
"error": "エラーメッセージ",
"request_id": 12345
}
よくあるエラー
認証エラー
- Wrong credentials: 無効なトークン
- Access from unauthorized IP: 許可されていないIPからのアクセス
- No IP: IPアドレスが取得できない
データエラー
- Username does not exist: 指定したユーザーが存在しない
- 更新失敗しました: データベース更新エラー