Codels
AI エージェントと開発者向け

モデル選びはエージェントにおまかせ。

Codels のすべてのモデルには、機械可読な「双子」があります。API キー不要、CORS 有効、URL は固定です。モデルページでAI エージェント用にコピーを押すか、エージェントに https://codels.download/llms.txt を教えて自分で検索させましょう。

「AI エージェント用にコピー」でクリップボードに入る内容

Add the 3D model "Pine Tree" from the Codels library to this three.js project.

1. First read the agent page (preview image, size, parts and ready-to-use code):
   https://codels.download/m/pine-tree.md?snow=true
2. Then integrate it:
   - Preferred: ES module https://codels.download/m/pine-tree.js?snow=true — exports createPineTree(): THREE.Group …
   - Or the binary glTF: https://codels.download/m/pine-tree.glb?snow=true
   - React Three Fiber component: https://codels.download/m/pine-tree.jsx?snow=true

Conventions: meters, +Y up, front faces +Z, origin at the center of the base (y = 0).

宙に浮くモデル(ピックアップアイテム、惑星など)は原点を中心に配置され、壁掛けのプロップは背面が z = 0 の平面上にあります。正確な原点はすべてのエージェント用ページに記載されています。

MCP サーバー

Codels を Claude Code、Cursor、Windsurf などの MCP クライアントに接続できます。エージェントは 6 つのツールを使えます:search_models、get_model(エージェントが実際に見られる 4 方向のプレビュー画像を返します)、get_model_code、list_packs、get_pack、list_categories。

claude mcp add --transport http codels https://codels.download/mcp

その他のクライアント(例:Cursor の mcp.json):

{
  "mcpServers": {
    "codels": {
      "url": "https://codels.download/mcp"
    }
  }
}

エンドポイント

/m/<slug>.md

エージェント用ページ:説明、プレビュー画像、サイズ、パーツ表、パラメーター、完全な three.js コード。1 回の取得ですべて揃います。

/m/<slug>.js

create<Name>(): THREE.Group をエクスポートする ES モジュール。three 以外の依存関係はありません。

/m/<slug>.jsx

React Three Fiber コンポーネント。

/m/<slug>.instanced.js

インスタンシング用モジュール:bake<Name>()(マテリアルごとに1ジオメトリ)+ create<Name>Instances(count, place) で、数百のコピーを少ないドローコールで描画。

/m/<slug>.html

単体で動くデモページ(three.js は CDN から読み込み)。

/m/<slug>.png · .sheet.png

プレビュー画像 / 4 方向シート(3/4、正面、側面、上面)。エージェントがモデルを「見る」ことができます。

/m/<slug>.glb · .gltf · .obj · .stl · .json

バイナリ/JSON の glTF、頂点カラー付き OBJ、STL、生の CodelSpec。

/api/v1/models?q=&category=&tags=&sort=

ファセット付きの検索。すべての結果の URL を返します。

/api/v1/models/<slug> · /api/v1/tags · /api/v1/categories

メタデータ、件数付きのタグ検索、カテゴリツリー。

/c/<pack>.md · .js · .zip · .json

パックと公開コレクション:エージェント用概要、全モデルを含む単一の ES モジュール、または GLB とモジュールの ZIP。

/llms.txt

このサイトの機械可読ガイド。

/mcp

検索・プレビュー・コードのツールを備えた Model Context Protocol エンドポイント(Streamable HTTP)。

パラメトリックなバリエーション

パラメトリックモデルは、どの URL でもパラメーターをクエリ文字列として受け付けます。.md ページには各パラメーターとその範囲が記載されています。

// fetch a taller pine with snow caps as a ready ES module
const src = await fetch('https://codels.download/m/pine-tree.js?height=5.5&snow=true').then((r) => r.text());

コードで使う

import * as THREE from 'three';
import { createPineTree } from './pine-tree.js';

const forest = new THREE.Group();
for (let i = 0; i < 40; i++) {
  const tree = createPineTree();
  tree.position.set((Math.random() - 0.5) * 60, 0, (Math.random() - 0.5) * 60);
  tree.rotation.y = Math.random() * Math.PI * 2;
  tree.scale.setScalar(0.8 + Math.random() * 0.5);
  forest.add(tree);
}
scene.add(forest);

コードから検索

const res = await fetch('https://codels.download/api/v1/models?q=medieval+barrel&sort=relevance');
const { items } = await res.json();
console.log(items[0].urls.code); // → https://codels.download/m/<slug>.js

レート制限と API キー

キーがなくてもすべて使えます(IP ごとに 1 分あたり 120 件の API リクエスト)。より多く使う場合は、無料のAPI キーを作成してください。1 分あたり 1,200 件のリクエストと利用統計が使えるようになります。キーは Authorization: Bearer cdl_… として送信します。レスポンスには X-RateLimit-Remaining が含まれ、429 が返ったときは再試行できるタイミングがわかります。

curl -H "Authorization: Bearer cdl_your_key" "https://codels.download/api/v1/models?q=barrel"
claude mcp add --transport http codels https://codels.download/mcp --header "Authorization: Bearer cdl_your_key"