### Run Example: Setup and Execution Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/openai-chat.mdx Provides shell commands to clone the Agentic repository, install dependencies, build the project, set up the OpenAI API key in a .env file, and then execute the OpenAI example using tsx. This requires git, Node.js, and pnpm. ```shell git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install pnpm build echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/ts-sdks/openai/bin/weather.ts ``` -------------------------------- ### Example Execution Commands Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/langchain.mdx Provides commands to clone the Agentic repository, install dependencies, build the project, set up the OpenAI API key in a `.env` file, and finally run the LangChain example using tsx. ```sh git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install pnpm build echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/ts-sdks/langchain/bin/weather.ts ``` -------------------------------- ### Run Agentic AI SDK Example Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/ai-sdk.mdx Provides shell commands to clone the Agentic repository, install dependencies, build the project, set up environment variables for OpenAI and Agentic API keys, and run the TypeScript AI SDK example. Ensure you have Git, Node.js, and pnpm installed. ```sh git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install pnpm build echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/ts-sdks/ai-sdk/bin/weather.ts ``` -------------------------------- ### Run Agentic OpenAI Example Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/openai-responses.mdx Steps to clone the Agentic repository, install dependencies, build the project, set up the OpenAI API key, and run the TypeScript example for OpenAI responses. ```shell git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install pnpm build echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/ts-sdks/openai/bin/weather-responses.ts ``` -------------------------------- ### Run Genkit Example (Shell) Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/genkit.mdx Provides shell commands to clone the Agentic repository, install dependencies, build the project, set up environment variables for API keys, and then run the Genkit example using `tsx`. This is a step-by-step guide to executing the provided TypeScript code. ```sh git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install pnpm build echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/ts-sdks/genkit/bin/weather.ts ``` -------------------------------- ### Run Mastra Example with Agentic Tools (Shell) Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/mastra.mdx Clones the Agentic repository, installs dependencies, builds the project, sets the OpenAI API key in a .env file, and then runs the Mastra weather example using tsx. ```shell git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install pnpm build echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/ts-sdks/mastra/bin/weather.ts ``` -------------------------------- ### Install Additional Dependencies for OpenAI Provider Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/ai-sdk.mdx Installs the `@ai-sdk/openai` provider and `dotenv` for managing environment variables, which are used in the Vercel AI SDK usage example. Available for npm, pnpm, bun, and yarn. ```bash npm install @ai-sdk/openai dotenv ``` ```bash pnpm add @ai-sdk/openai dotenv ``` ```bash bun add @ai-sdk/openai dotenv ``` ```bash yarn add @ai-sdk/openai dotenv ``` -------------------------------- ### Create a FastMCP Server in Python Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/guides/py-fastmcp.mdx Example of creating a basic MCP server using the FastMCP framework in Python. It includes defining a simple 'add' tool and running the server with HTTP transport. ```python from fastmcp import FastMCP mcp = FastMCP("Demo 🚀") @mcp.tool def add(a: int, b: int) -> int: """Add two numbers""" return a + b if __name__ == "__main__": mcp.run(transport="http", host="127.0.0.1", port=8000, path="/mcp") ``` -------------------------------- ### Run LlamaIndex Agent Example Locally Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/llamaindex.mdx Provides commands to clone the Agentic repository, install dependencies, build the project, set up environment variables (OpenAI API key), and run the LlamaIndex weather example using tsx. ```bash git clone git@github.com:transitive-bullshit/agentic.git cd agentic pnpm install pnpm build echo 'OPENAI_API_KEY=your-key' >> .env npx tsx examples/ts-sdks/llamaindex/bin/weather.ts ``` -------------------------------- ### Install fastmcp Package Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/guides/py-fastmcp.mdx Instructions for installing the 'fastmcp' Python package using both 'uv' and 'pip' package managers. Ensure Python is installed beforehand. ```bash uv add fastmcp ``` ```bash pip install fastmcp ``` -------------------------------- ### Install @agentic/platform-api-client Source: https://github.com/transitive-bullshit/agentic/blob/main/packages/api-client/readme.md This snippet shows how to install the `@agentic/platform-api-client` package using npm. This is the first step to integrating the Agentic platform API into your project. ```bash npm i @agentic/platform-api-client ``` -------------------------------- ### Install @agentic/ai-sdk Package Source: https://github.com/transitive-bullshit/agentic/blob/main/stdlib/ai-sdk/readme.md This snippet shows how to install the @agentic/ai-sdk package along with its dependencies, zod and ai, using npm. Ensure you have Node.js and npm installed. ```bash npm i @agentic/ai-sdk zod ai ``` -------------------------------- ### Install @agentic/platform-openapi-utils Source: https://github.com/transitive-bullshit/agentic/blob/main/packages/openapi-utils/readme.md This snippet shows how to install the @agentic/platform-openapi-utils package using npm. This is a foundational step for integrating the package into your project. ```bash npm i @agentic/platform-openapi-utils ``` -------------------------------- ### Install Agentic CLI Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/guides/existing-openapi-service.mdx Installs the Agentic CLI globally using various package managers. Ensure Node.js is installed beforehand. ```bash npm i -g @agentic/cli ``` ```bash pnpm i -g @agentic/cli ``` ```bash bun install -g @agentic/cli ``` ```bash yarn global add @agentic/cli ``` -------------------------------- ### Configure Free Monthly Pricing Plan for Agentic Gateway Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/config/examples.mdx This example configures a 'Free' monthly pricing plan for the Agentic MCP Gateway, which is used by default if no other plans are specified. It includes a base line item with zero cost and a rate limit. ```typescript import { defineConfig } from '@agentic/platform' export default defineConfig({ name: 'Free Monthly Pricing Example', description: "This example shows the free monthly pricing plan which is used by default for projects that don't specify any pricing plans.", origin: { type: 'mcp', url: 'https://agentic-basic-mcp-test.onrender.com/mcp' }, pricingPlans: [ { name: 'Free', slug: 'free', lineItems: [ { slug: 'base', usageType: 'licensed', amount: 0 } ], rateLimit: { enabled: true, interval: 60, limit: 1000 } } ] }) ``` ```json { "$schema": "https://agentic.so/schema.json", "name": "Free Monthly Pricing Example", "description": "This example shows the free monthly pricing plan which is used by default for projects that don't specify any pricing plans.", "origin": { "type": "mcp", "url": "https://agentic-basic-mcp-test.onrender.com/mcp" }, "pricingPlans": [ { "name": "Free", "slug": "free", "lineItems": [ { "slug": "base", "usageType": "licensed", "amount": 0 } ], "rateLimit": { "enabled": true, "interval": 60, "limit": 1000 } } ] } ``` -------------------------------- ### Example Rate Limits Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/config/rate-limits.mdx Provides examples of different rate limit configurations, including default, strict daily, and disabled states. ```APIDOC ## Example Rate Limits ### Description This section provides concrete examples of how to configure rate limits for different scenarios. ### Scenarios #### Default Rate Limit - **Description**: The default platform rate limit for `requests` is a limit of 1000 requests per minute per customer. - **Configuration**: ```json { "enabled": true, "interval": "1m", "limit": 1000 } ``` #### Strict Daily Rate Limit - **Description**: This example rate limit restricts customers to 100 requests per day. It uses `strict` mode, which adds a small amount of latency but guarantees that customers will never exceed the limit. - **Configuration**: ```json { "enabled": true, "interval": "1d", "limit": 100, "mode": "strict" } ``` #### Disabled Rate Limit - **Description**: This is an example of a disabled rate limit. - **Configuration**: ```json { "enabled": false } ``` ``` -------------------------------- ### Configure Basic OpenAPI Origin for Agentic Gateway Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/config/examples.mdx This example shows how to configure the Agentic MCP Gateway to use an origin server that exposes an OpenAPI specification. It requires the '@agentic/platform' package and the path to the OpenAPI spec file. ```typescript import { defineConfig } from '@agentic/platform' export default defineConfig({ name: 'Basic OpenAPI Example', description: "This example shows how to configure Agentic's MCP gateway with an origin OpenAPI server.", origin: { type: 'openapi', url: 'https://jsonplaceholder.typicode.com', spec: './jsonplaceholder.json' } }) ``` ```json { "$schema": "https://agentic.so/schema.json", "name": "Basic OpenAPI Example", "description": "This example shows how to configure Agentic's MCP gateway with an origin OpenAPI server.", "origin": { "type": "openapi", "url": "https://jsonplaceholder.typicode.com", "spec": "./jsonplaceholder.json" } } ``` -------------------------------- ### Install @agentic/genkit and zod Source: https://github.com/transitive-bullshit/agentic/blob/main/stdlib/genkit/readme.md This command installs the @agentic/genkit package and its dependency, zod, using npm. Ensure you have Node.js and npm installed. ```bash npm i @agentic/genkit zod ``` -------------------------------- ### Install Agentic AI SDK and Platform Tool Client Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/ai-sdk.mdx Installs the necessary packages for using Agentic tools with the Vercel AI SDK using different package managers. Ensure you have Node.js and your preferred package manager installed. ```bash npm install ai @agentic/ai-sdk @agentic/platform-tool-client ``` ```bash pnpm add ai @agentic/ai-sdk @agentic/platform-tool-client ``` ```bash bun add ai @agentic/ai-sdk @agentic/platform-tool-client ``` ```bash yarn add ai @agentic/ai-sdk @agentic/platform-tool-client ``` -------------------------------- ### Install Agentic Platform Tool Client and OpenAI SDK Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/openai-chat.mdx Installs the necessary npm packages for using Agentic tools with the OpenAI SDK. Ensure you have Node.js and a package manager (npm, pnpm, bun, or yarn) installed. ```bash npm install openai @agentic/platform-tool-client ``` ```bash pnpm add openai @agentic/platform-tool-client ``` ```bash bun add openai @agentic/platform-tool-client ``` ```bash yarn add openai @agentic/platform-tool-client ``` -------------------------------- ### Install Mastra and Agentic Tools (npm, pnpm, bun, yarn) Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/mastra.mdx Installs the necessary Mastra core, Agentic Mastra integration, and Agentic platform tool client packages. Supports npm, pnpm, bun, and yarn package managers. ```bash npm install @mastra/core @agentic/mastra @agentic/platform-tool-client ``` ```bash pnpm add @mastra/core @agentic/mastra @agentic/platform-tool-client ``` ```bash bun add @mastra/core @agentic/mastra @agentic/platform-tool-client ``` ```bash yarn add @mastra/core @agentic/mastra @agentic/platform-tool-client ``` -------------------------------- ### TypeScript Usage Example with Vercel AI SDK and Agentic Search Tool Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/ai-sdk.mdx Demonstrates how to use the Agentic search tool with the Vercel AI SDK in a TypeScript environment. This example requires Node.js, dotenv for environment variables, and the ai-sdk openai provider. ```typescript import 'dotenv/config' import { createAISDKTools } from '@agentic/ai-sdk' import { AgenticToolClient } from '@agentic/platform-tool-client' import { createOpenAI } from '@ai-sdk/openai' import { generateText } from 'ai' async function main() { const searchTool = await AgenticToolClient.fromIdentifier('@agentic/search') const openai = createOpenAI({ compatibility: 'strict' }) const result = await generateText({ model: openai('gpt-4o-mini'), tools: createAISDKTools(searchTool), toolChoice: 'required', temperature: 0, system: 'You are a helpful assistant. Be as concise as possible.', prompt: 'What is the weather in San Francisco?' }) console.log(JSON.stringify(result.toolResults[0], null, 2)) } await main() ``` -------------------------------- ### Install Dependencies for Hono MCP Server Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/guides/ts-mcp-hono.mdx Installs necessary npm packages for building an MCP server with Hono. This includes Hono, the Node.js server adapter, Hono's MCP middleware, the MCP SDK, and Zod for schema validation. It provides commands for npm, pnpm, bun, and yarn. ```bash npm add hono @hono/node-server @hono/mcp @modelcontextprotocol/sdk zod ``` ```bash pnpm add hono @hono/node-server @hono/mcp @modelcontextprotocol/sdk zod ``` ```bash bun add hono @hono/node-server @hono/mcp @modelcontextprotocol/sdk zod ``` ```bash yarn add hono @hono/node-server @hono/mcp @modelcontextprotocol/sdk zod ``` -------------------------------- ### Install Agentic Platform package for TypeScript configuration Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/guides/existing-mcp-server.mdx Installs the `@agentic/platform` package as a development dependency. This package provides type safety and autocompletion for the Agentic configuration file. ```bash npm i -save-dev @agentic/platform ``` ```bash pnpm add -D @agentic/platform ``` ```bash bun add -d @agentic/platform ``` -------------------------------- ### Configure Basic MCP Origin for Agentic Gateway Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/config/examples.mdx This example demonstrates how to configure the Agentic MCP Gateway to use a basic MCP origin server via the Streamable HTTP transport. It requires the '@agentic/platform' package for the defineConfig function. ```typescript import { defineConfig } from '@agentic/platform' export default defineConfig({ name: 'Basic MCP Example', description: "This example shows how to configure Agentic's MCP gateway with an origin MCP server using the Streamable HTTP transport.", origin: { type: 'mcp', url: 'https://agentic-basic-mcp-test.onrender.com/mcp' } }) ``` ```json { "$schema": "https://agentic.so/schema.json", "name": "Basic MCP Example", "description": "This example shows how to configure Agentic's MCP gateway with an origin MCP server using the Streamable HTTP transport.", "origin": { "type": "mcp", "url": "https://agentic-basic-mcp-test.onrender.com/mcp" } } ``` -------------------------------- ### Deployments - Get Deployment by Identifier Source: https://context7.com/transitive-bullshit/agentic/llms.txt Retrieves deployment details including configuration and pricing. ```APIDOC ## GET /v1/deployments/{identifier} ### Description Retrieves deployment details including configuration and pricing. ### Method GET ### Endpoint /v1/deployments/{identifier} #### Path Parameters - **identifier** (string) - Required - The identifier of the deployment (e.g., `@johndoe/search@1.0.0`). #### Query Parameters - **populate** (string) - Optional - Specifies related resources to include (e.g., 'project'). ``` -------------------------------- ### Get Project by Identifier (Bash) Source: https://context7.com/transitive-bullshit/agentic/llms.txt Retrieves a specific project using its unique identifier. Supports populating related deployment information. Requires a JWT token for authorization. ```bash curl -X GET "https://api.agentic.so/v1/projects/@johndoe/search?populate=lastPublishedDeployment&populate=lastDeployment" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" ``` -------------------------------- ### Pay-As-You-Go Plan Configuration Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/config/pricing.mdx Sets up a pay-as-you-go pricing model with a free tier and a metered tier with volume-based pricing. ```APIDOC ## Pay-As-You-Go Plan Configuration ### Description This example demonstrates a pay-as-you-go pricing structure. It includes a free tier limited to 20 requests per day, and a metered tier that charges based on usage volume, with different rates for the first 999 requests and subsequent requests. ### Method Configuration ### Endpoint N/A ### Parameters #### Request Body - **pricingPlans** (array) - Required - An array of pricing plan objects. - **name** (string) - Required - The name of the pricing plan. - **slug** (string) - Required - A unique identifier for the pricing plan. - **lineItems** (array) - Required - A list of line items for the plan. - **slug** (string) - Required - A unique identifier for the line item. - **usageType** (string) - Required - The type of usage ('licensed' or 'metered'). - **billingScheme** (string) - Required - The billing scheme ('tiered' or 'per_unit'). - **tiersMode** (string) - Optional - The mode for tiers ('volume' or 'segmented'). - **tiers** (array) - Optional - Defines usage tiers for metered billing. - **upTo** (number or 'inf') - Required - The upper limit for the tier. - **unitAmount** (number) - Required - The cost per unit within this tier (in cents). - **amount** (number) - Required - The fixed amount to charge per billing interval (if not using tiers). - **rateLimit** (object) - Optional - Defines rate limiting for the plan. - **limit** (number) - Required - The maximum number of requests allowed. - **interval** (string) - Required - The time interval for the limit (e.g., '1d' for daily). ### Request Example ```ts import { defineConfig } from '@agentic/platform' export default defineConfig({ // ... pricingPlans: [ { name: 'Free', slug: 'free', lineItems: [ { slug: 'base', usageType: 'licensed', amount: 0 } ], // Free but limited to 20 requests per day rateLimit: { limit: 20, interval: '1d' } }, { name: 'Pay-As-You-Go', slug: 'pay-as-you-go', lineItems: [ { slug: 'requests', usageType: 'metered', billingScheme: 'tiered', tiersMode: 'volume', // $0.00467 USD per request up to 999 requests per month // then $0.00053 USD for unlimited further requests that month tiers: [ { upTo: 999, unitAmount: 0.467 }, { upTo: 'inf', unitAmount: 0.053 } ] } ], // Limit to 1000 requests per day rateLimit: { limit: 1000, interval: '1d' } } ] }) ``` ### Response #### Success Response (200) Configuration applied successfully. #### Response Example N/A ``` -------------------------------- ### Freemium and Basic Plan Configuration Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/config/pricing.mdx Sets up two pricing plans: a default free plan and a 'Basic' plan costing $4.99 per month with a 7-day trial. The Basic plan also uses a licensed usage type with a fixed amount. ```typescript import { defaultFreePricingPlan, defineConfig } from '@agentic/platform' export default defineConfig({ // ... pricingPlans: [ defaultFreePricingPlan, { name: 'Basic', slug: 'basic', trialPeriodDays: 7, lineItems: [ { slug: 'base', usageType: 'licensed', amount: 499 // $4.99 USD } ] } ] }) ``` -------------------------------- ### Authenticate User - Sign Up with Password (Bash) Source: https://context7.com/transitive-bullshit/agentic/llms.txt Creates a new user account with the provided email, password, username, and name. Requires a JSON payload with these details. ```bash curl -X POST https://api.agentic.so/v1/auth/password/signup \ -H "Content-Type: application/json" \ -d '{ "email": "newuser@example.com", "password": "SecurePassword123!", "username": "newuser", "name": "New User" }' ``` -------------------------------- ### Install Additional LangChain OpenAI and Dotenv Dependencies Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/langchain.mdx Installs the `@langchain/openai` package for OpenAI integration and `dotenv` for managing environment variables, using various package managers. This is optional and specific to examples requiring OpenAI functionality. ```bash npm install @langchain/openai dotenv ``` ```bash pnpm add @langchain/openai dotenv ``` ```bash bun add @langchain/openai dotenv ``` ```bash yarn add @langchain/openai dotenv ``` -------------------------------- ### Pay-As-You-Go Pricing Plan Configuration Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/config/pricing.mdx Implements a 'Pay-As-You-Go' pricing strategy with tiered rates for usage. It includes a free tier limited to 20 requests per day and a metered tier with different unit amounts based on usage volume, capped at 1000 requests per day. ```typescript import { defineConfig } from '@agentic/platform' export default defineConfig({ // ... pricingPlans: [ { name: 'Free', slug: 'free', lineItems: [ { slug: 'base', usageType: 'licensed', amount: 0 } ], // Free but limited to 20 requests per day rateLimit: { limit: 20, interval: '1d' } }, { name: 'Pay-As-You-Go', slug: 'pay-as-you-go', lineItems: [ { slug: 'requests', usageType: 'metered', billingScheme: 'tiered', tiersMode: 'volume', // $0.00467 USD per request up to 999 requests per month // then $0.00053 USD for unlimited further requests that month tiers: [ { upTo: 999, unitAmount: 0.467 }, { upTo: 'inf', unitAmount: 0.053 } ] } ], // Limit to 1000 requests per day rateLimit: { limit: 1000, interval: '1d' } } ] }) ``` -------------------------------- ### Create a ModelFetch MCP Server Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/guides/ts-modelfetch.mdx This command initializes a new ModelFetch MCP server project. It prompts the user to select a runtime (e.g., Node.js, Vercel), a language (TypeScript or JavaScript), and a package manager (npm, pnpm, bun, yarn). After creation, navigate into the project directory. ```bash npx -y create-modelfetch@latest cd my-mcp-server ``` -------------------------------- ### Install Additional Dependencies for OpenAI Support (npm, pnpm, bun, yarn) Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/genkit.mdx Installs the `genkitx-openai` and `dotenv` packages, which are required to enable OpenAI integration with Genkit and to manage environment variables like API keys. These are optional for Agentic tool usage but used in the example. ```bash npm install genkitx-openai dotenv ``` ```bash pnpm add genkitx-openai dotenv ``` ```bash bun add genkitx-openai dotenv ``` ```bash yarn add genkitx-openai dotenv ``` -------------------------------- ### List Public Projects (Bash) Source: https://context7.com/transitive-bullshit/agentic/llms.txt Lists all publicly available projects. Supports pagination, filtering by tags, and sorting. Requires no authentication. ```bash curl -X GET "https://api.agentic.so/v1/projects/public?limit=20&offset=0&sort=desc&sortBy=createdAt&tag=search" \ -H "Content-Type: application/json" ``` -------------------------------- ### Default Rate Limit Configuration (TypeScript) Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/config/rate-limits.mdx Configures a default rate limit allowing 1000 requests per minute. This is an example of a common rate-limiting setup using TypeScript. ```typescript { enabled: true, interval: '1m', limit: 1000 } ``` -------------------------------- ### TypeScript Example: OpenAI Responses with Agentic Search Tool Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/openai-responses.mdx Demonstrates how to use the Agentic @agentic/search tool with the OpenAI Responses API in TypeScript. It first calls OpenAI to get a tool call, then executes the tool, and finally calls OpenAI again to get a text response based on the tool's output. Requires environment variables for API keys. ```typescript import 'dotenv/config' import { assert } from '@agentic/core' import { AgenticToolClient } from '@agentic/platform-tool-client' import OpenAI from 'openai' async function main() { const searchTool = await AgenticToolClient.fromIdentifier('@agentic/search') const openai = new OpenAI() const messages: OpenAI.Responses.ResponseInput = [ { role: 'system', content: 'You are a helpful assistant. Be as concise as possible.' }, { role: 'user', content: 'What is the weather in San Francisco?' } ] { // First call to OpenAI to invoke the tool const res = await openai.responses.create({ model: 'gpt-4o-mini', temperature: 0, tools: searchTool.functions.responsesToolSpecs, tool_choice: 'required', input: messages }) const toolCall = res.output[0] assert(toolCall?.type === 'function_call') const toolResult = await searchTool.callTool( toolCall.name, toolCall.arguments ) messages.push(toolCall) messages.push({ type: 'function_call_output', call_id: toolCall.call_id, output: JSON.stringify(toolResult) }) } { // Second call to OpenAI to generate a text response const res = await openai.responses.create({ model: 'gpt-4o-mini', temperature: 0, tools: searchTool.functions.responsesToolSpecs, input: messages }) console.log(res.output_text) } } await main() ``` -------------------------------- ### Freemium + $4.99 Basic Plan Configuration Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/config/pricing.mdx Configures a freemium model with a default free plan and a paid basic plan at $4.99/month with a trial period. ```APIDOC ## Freemium + $4.99 Basic Plan Configuration ### Description This example has 2 pricing plans, the default free plan and a fixed-price $4.99 / month basic plan with a 7-day trial. ### Method Configuration ### Endpoint N/A ### Parameters #### Request Body - **pricingPlans** (array) - Required - An array of pricing plan objects. - **name** (string) - Required - The name of the pricing plan. - **slug** (string) - Required - A unique identifier for the pricing plan. - **trialPeriodDays** (number) - Optional - The number of days for the trial period. - **lineItems** (array) - Required - A list of line items for the plan. - **slug** (string) - Required - A unique identifier for the line item. - **usageType** (string) - Required - The type of usage ('licensed' or 'metered'). - **amount** (number) - Required - The fixed amount to charge per billing interval (in cents). ### Request Example ```ts import { defaultFreePricingPlan, defineConfig } from '@agentic/platform' export default defineConfig({ // ... pricingPlans: [ defaultFreePricingPlan, { name: 'Basic', slug: 'basic', trialPeriodDays: 7, lineItems: [ { slug: 'base', usageType: 'licensed', amount: 499 // $4.99 USD } ] } ] }) ``` ### Response #### Success Response (200) Configuration applied successfully. #### Response Example N/A ``` -------------------------------- ### Authentication - Sign Up with Password Source: https://context7.com/transitive-bullshit/agentic/llms.txt Creates a new user account with the provided email and password. ```APIDOC ## POST /v1/auth/password/signup ### Description Creates a new user account with email, password, username, and name. ### Method POST ### Endpoint https://api.agentic.so/v1/auth/password/signup ### Parameters #### Request Body - **email** (string) - Required - The desired email address for the new account. - **password** (string) - Required - The password for the new account. - **username** (string) - Required - The desired username for the new account. - **name** (string) - Required - The full name of the user. ### Request Example ```json { "email": "newuser@example.com", "password": "SecurePassword123!", "username": "newuser", "name": "New User" } ``` ``` -------------------------------- ### Install LlamaIndex and Agentic Packages Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/marketplace/ts-sdks/llamaindex.mdx Installs the necessary LlamaIndex and Agentic packages for TypeScript projects using npm, pnpm, bun, or yarn. Ensure you have Node.js and a package manager installed. ```bash npm install llamaindex @llamaindex/workflow @agentic/llamaindex @agentic/platform-tool-client ``` ```bash pnpm add llamaindex @llamaindex/workflow @agentic/llamaindex @agentic/platform-tool-client ``` ```bash bun add llamaindex @llamaindex/workflow @agentic/llamaindex @agentic/platform-tool-client ``` ```bash yarn add llamaindex @llamaindex/workflow @agentic/llamaindex @agentic/platform-tool-client ``` -------------------------------- ### Configure Pay-As-You-Go Pricing Plan Source: https://context7.com/transitive-bullshit/agentic/llms.txt Sets up a tiered, usage-based pricing plan for an API service. This configuration includes defining line items for metered usage, specifying billing tiers with different unit amounts, and setting rate limits. ```typescript // agentic.config.ts import { defineConfig } from '@agentic/platform' export default defineConfig({ name: 'Premium Search API', origin: { type: 'raw', url: 'https://api.premium-search.com' }, pricingPlans: [ { name: 'Free', slug: 'free', lineItems: [ { slug: 'base', usageType: 'licensed', amount: 0 }, { slug: 'requests', usageType: 'metered', billingScheme: 'per_unit', unitAmount: 0 } ], rateLimit: { limit: 20, interval: 60 * 60 * 24 // 1 day in seconds } }, { name: 'Pay-As-You-Go', slug: 'pay-as-you-go', lineItems: [ { slug: 'requests', usageType: 'metered', billingScheme: 'tiered', tiersMode: 'volume', tiers: [ { upTo: 999, unitAmount: 0.467 // $0.00467 USD per request }, { upTo: 'inf', unitAmount: 0.053 // $0.00053 USD per request } ] } ], rateLimit: { limit: 1000, interval: '1d' } } ] }) ``` -------------------------------- ### Create Project (Bash) Source: https://context7.com/transitive-bullshit/agentic/llms.txt Creates a new project namespace for organizing deployments. Requires a JWT token for authorization and a JSON payload with project name and slug. ```bash curl -X POST https://api.agentic.so/v1/projects \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "My Search API", "slug": "search" }' ``` -------------------------------- ### Install FastMCP and Zod Dependencies Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/guides/ts-fastmcp.mdx Installs the necessary FastMCP and Zod packages using various package managers. Zod is used for schema validation. Ensure Node.js is installed before proceeding. ```bash npm add fastmcp zod ``` ```bash pnpm add fastmcp zod ``` ```bash bun add fastmcp zod ``` ```bash yarn add fastmcp zod ``` -------------------------------- ### Install @agentic/platform Package Source: https://github.com/transitive-bullshit/agentic/blob/main/packages/platform/readme.md Installs the @agentic/platform package using npm. This is a prerequisite for using the Agentic SDK in your project. ```bash npm i @agentic/platform ``` -------------------------------- ### Install @agentic/cli Source: https://github.com/transitive-bullshit/agentic/blob/main/packages/cli/readme.md Installs the Agentic CLI globally on your system using npm. This makes the 'agentic' command available in your terminal. ```bash npm i -g @agentic/cli ``` -------------------------------- ### Agentic CLI Login and Signup Commands Source: https://github.com/transitive-bullshit/agentic/blob/main/docs/publishing/guides/existing-mcp-server.mdx Authenticates with the Agentic platform. The `login` command can use GitHub by default or specific email and password. The `signup` command creates a new account with a username, email, and password. ```bash agentic login ``` ```bash agentic login -e -p # or agentic signup -e -p -u ``` -------------------------------- ### Create Deployment with MCP or OpenAPI Source: https://context7.com/transitive-bullshit/agentic/llms.txt Creates a new deployment with configuration for MCP or OpenAPI origin adapters. Requires a JWT token for authentication and a JSON payload specifying deployment details like name, slug, origin URL, and pricing plans. The response includes the deployment's ID, identifier, and creation timestamp. ```bash curl -X POST "https://api.agentic.so/v1/deployments?publish=false" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "My Search API", "slug": "search", "origin": { "type": "mcp", "url": "https://my-mcp-server.com/mcp" }, "pricingPlans": [ { "name": "Free", "slug": "free", "lineItems": [ { "slug": "base", "usageType": "licensed", "amount": 0 }, { "slug": "requests", "usageType": "metered", "billingScheme": "per_unit", "unitAmount": 0 } ], "rateLimit": { "limit": 100, "interval": 3600 } } ] }' ``` -------------------------------- ### Install @agentic/platform-validators Package Source: https://github.com/transitive-bullshit/agentic/blob/main/packages/validators/readme.md This snippet demonstrates how to install the @agentic/platform-validators package using npm. This package is essential for utilizing the validation functionalities provided by the Agentic platform. ```bash npm i @agentic/platform-validators ``` -------------------------------- ### Install @agentic/core Package Source: https://github.com/transitive-bullshit/agentic/blob/main/stdlib/core/readme.md Installs the @agentic/core package along with zod for schema validation. This is a prerequisite for using the Agentic AI utilities. ```bash npm i @agentic/core zod ``` -------------------------------- ### Pay-As-You-Go Pricing Configuration Source: https://context7.com/transitive-bullshit/agentic/llms.txt Advanced configuration with tiered usage-based pricing and rate limits for a service. ```APIDOC ## Pay-As-You-Go Pricing Configuration ### Description Advanced configuration with tiered usage-based pricing and rate limits. ### Method N/A (Configuration file) ### Endpoint N/A (Configuration file) ### Parameters N/A ### Request Example ```typescript // agentic.config.ts import { defineConfig } from '@agentic/platform' export default defineConfig({ name: 'Premium Search API', origin: { type: 'raw', url: 'https://api.premium-search.com' }, pricingPlans: [ { name: 'Free', slug: 'free', lineItems: [ { slug: 'base', usageType: 'licensed', amount: 0 }, { slug: 'requests', usageType: 'metered', billingScheme: 'per_unit', unitAmount: 0 } ], rateLimit: { limit: 20, interval: 60 * 60 * 24 // 1 day in seconds } }, { name: 'Pay-As-You-Go', slug: 'pay-as-you-go', lineItems: [ { slug: 'requests', usageType: 'metered', billingScheme: 'tiered', tiersMode: 'volume', tiers: [ { upTo: 999, unitAmount: 0.467 // $0.00467 USD per request }, { upTo: 'inf', unitAmount: 0.053 // $0.00053 USD per request } ] } ], rateLimit: { limit: 1000, interval: '1d' } } ] }) ``` ### Response N/A (Configuration file) ``` -------------------------------- ### Deployments - Create Deployment Source: https://context7.com/transitive-bullshit/agentic/llms.txt Creates a new deployment with configuration for MCP or OpenAPI origin adapters. ```APIDOC ## POST /v1/deployments ### Description Creates a new deployment with configuration for MCP or OpenAPI origin adapters. ### Method POST ### Endpoint /v1/deployments #### Query Parameters - **publish** (boolean) - Optional - Whether to publish the deployment immediately. #### Request Body - **name** (string) - Required - The name of the deployment. - **slug** (string) - Required - The slug for the deployment. - **origin** (object) - Required - The origin adapter configuration. - **type** (string) - Required - The type of origin adapter (e.g., 'mcp', 'openapi'). - **url** (string) - Required - The URL of the origin adapter. - **pricingPlans** (array) - Required - An array of pricing plan configurations. - **name** (string) - Required - The name of the pricing plan. - **slug** (string) - Required - The slug for the pricing plan. - **lineItems** (array) - Required - An array of line items for the pricing plan. - **slug** (string) - Required - The slug for the line item. - **usageType** (string) - Required - The usage type (e.g., 'licensed', 'metered'). - **amount** (number) - Optional - The fixed amount for the line item. - **billingScheme** (string) - Optional - The billing scheme (e.g., 'per_unit'). - **unitAmount** (number) - Optional - The per-unit amount for metered usage. - **rateLimit** (object) - Optional - The rate limit configuration for the plan. - **limit** (integer) - Required - The maximum number of requests allowed. - **interval** (integer) - Required - The interval in seconds for the rate limit. ### Request Example ```json { "name": "My Search API", "slug": "search", "origin": { "type": "mcp", "url": "https://my-mcp-server.com/mcp" }, "pricingPlans": [ { "name": "Free", "slug": "free", "lineItems": [ { "slug": "base", "usageType": "licensed", "amount": 0 }, { "slug": "requests", "usageType": "metered", "billingScheme": "per_unit", "unitAmount": 0 } ], "rateLimit": { "limit": 100, "interval": 3600 } } ] } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the deployment. - **identifier** (string) - The identifier of the deployment (e.g., `@johndoe/search@a1b2c3d4`). - **hash** (string) - A hash of the deployment configuration. - **projectId** (string) - The ID of the project the deployment belongs to. - **name** (string) - The name of the deployment. - **published** (boolean) - Whether the deployment is published. - **origin** (object) - The origin adapter configuration. - **pricingPlans** (array) - The pricing plans for the deployment. - **createdAt** (string) - The timestamp when the deployment was created. #### Response Example ```json { "id": "deployment_xyz789", "identifier": "@johndoe/search@a1b2c3d4", "hash": "a1b2c3d4", "projectId": "project_tz4a98xxat96iws9zmbrgj3a", "name": "My Search API", "published": false, "origin": { "type": "mcp", "url": "https://my-mcp-server.com/mcp" }, "pricingPlans": [...], "createdAt": "2025-01-15T12:00:00Z" } ``` ``` -------------------------------- ### Install @agentic/platform-types Package Source: https://github.com/transitive-bullshit/agentic/blob/main/packages/types/readme.md Installs the core Agentic platform types package using npm. This is a prerequisite for using the types in your project. ```bash npm i @agentic/platform-types ``` -------------------------------- ### Projects - Create Project Source: https://context7.com/transitive-bullshit/agentic/llms.txt Creates a new project namespace to organize deployments. ```APIDOC ## POST /v1/projects ### Description Creates a new project namespace for organizing deployments. ### Method POST ### Endpoint https://api.agentic.so/v1/projects ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **name** (string) - Required - The display name of the project. - **slug** (string) - Required - A URL-friendly identifier for the project. ### Request Example ```json { "name": "My Search API", "slug": "search" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the created project. - **identifier** (string) - The unique identifier for the project, often in the format "@namespace/slug". - **namespace** (string) - The user's namespace. - **slug** (string) - The project's slug. - **name** (string) - The project's display name. - **userId** (string) - The ID of the user who owns the project. - **private** (boolean) - Indicates if the project is private. - **createdAt** (string) - Timestamp of project creation (ISO 8601 format). - **updatedAt** (string) - Timestamp of last project update (ISO 8601 format). #### Response Example ```json { "id": "project_tz4a98xxat96iws9zmbrgj3a", "identifier": "@johndoe/search", "namespace": "johndoe", "slug": "search", "name": "My Search API", "userId": "user_tz4a98xxat96iws9zmbrgj3a", "private": true, "createdAt": "2025-01-15T11:00:00Z", "updatedAt": "2025-01-15T11:00:00Z" } ``` ```