# Models ## Model Search `client.ai.models.list(ModelListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/ai/models/search` Searches Workers AI models by name or description. ### Parameters - `params: ModelListParams` - `account_id: string` Path param - `author?: string` Query param: Filter by Author - `hide_experimental?: boolean` Query param: Filter to hide experimental models - `page?: number` Query param - `per_page?: number` Query param - `search?: string` Query param: Search - `source?: number` Query param: Filter by Source Id - `task?: string` Query param: Filter by Task Name ### Returns - `ModelListResponse = unknown` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const modelListResponse of client.ai.models.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', })) { console.log(modelListResponse); } ``` #### Response ```json { "errors": [ {} ], "messages": [ "string" ], "result": [ {} ], "success": true } ``` ## Domain Types ### Model List Response - `ModelListResponse = unknown` # Schema ## Get Model Schema `client.ai.models.schema.get(SchemaGetParamsparams, RequestOptionsoptions?): SchemaGetResponse` **get** `/accounts/{account_id}/ai/models/schema` Retrieves the input and output JSON schema definition for a Workers AI model. ### Parameters - `params: SchemaGetParams` - `account_id: string` Path param - `model: string` Query param: Model Name ### Returns - `SchemaGetResponse` - `input: Input` - `additionalProperties: boolean` - `description: string` - `type: string` - `output: Output` - `additionalProperties: boolean` - `description: string` - `type: string` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const schema = await client.ai.models.schema.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', model: 'model', }); console.log(schema.input); ``` #### Response ```json { "result": { "input": { "additionalProperties": true, "description": "JSON Schema definition for the model's input parameters", "type": "object" }, "output": { "additionalProperties": true, "description": "JSON Schema definition for the model's output format", "type": "object" } }, "success": true } ``` ## Domain Types ### Schema Get Response - `SchemaGetResponse` - `input: Input` - `additionalProperties: boolean` - `description: string` - `type: string` - `output: Output` - `additionalProperties: boolean` - `description: string` - `type: string`