> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyzr.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create OpenAPI Tool Endpoint

### Endpoint

**POST** `/v3/tools/`

### Description

Creates a new tool using an OpenAPI schema with custom configurations.

### Authentication

API Key (`x-api-key`) in the header.

### Request Parameters

| Parameter              | Type    | Description                                       |
| ---------------------- | ------- | ------------------------------------------------- |
| `tool_set_name`        | String  | Name for the tool set (prefixed with `openapi-`). |
| `openapi_schema`       | Object  | OpenAPI schema for tool definition.               |
| `default_headers`      | Object  | Optional default headers for requests.            |
| `default_query_params` | Object  | Optional default query parameters.                |
| `default_body_params`  | Object  | Optional default body parameters.                 |
| `endpoint_defaults`    | Object  | Optional endpoint-specific default parameters.    |
| `enhance_descriptions` | Boolean | Whether to enhance descriptions using OpenAI.     |
| `openai_api_key`       | String  | OpenAI API key (if enhancement is enabled).       |

### Request Example

```json theme={null}
{
  "tool_set_name": "hello",
  "openapi_schema": {
    "openapi": "3.0.0",
    "info": {
      "title": "Sample API",
      "version": "1.0.0",
      "description": "A sample API specification"
    },
    "servers": [
      {
        "url": "https://api.example.com/v1",
        "description": "Production server"
      }
    ]
  },
  "default_headers": {
    "Content-Type": "application/json"
  },
  "enhance_descriptions": true,
  "openai_api_key": "YOUR_OPENAI_API_KEY"
}
```

### Curl Request

```bash theme={null}
curl -X POST "https://agent-prod.studio.lyzr.ai/v3/tools/" ^
-H "accept: application/json" ^
-H "content-type: application/json" ^
-H "x-api-key: sk-default-REDACTED" ^
-d '{"tool_set_name":"string","openapi_schema":{},"default_headers":{},"default_query_params":{},"default_body_params":{},"endpoint_defaults":{},"enhance_descriptions":false,"openai_api_key":null}'
```

### Response

Returns tool IDs for the created tools.

***


## OpenAPI

````yaml post /tools/
openapi: 3.0.3
info:
  title: Lyzr Tool API
  version: 1.0.0
servers:
  - url: https://agent-prod.studio.lyzr.ai/v3
security: []
paths:
  /tools/:
    post:
      tags:
        - Tools
      summary: Create OpenAPI Tool
      description: Creates a new tool using an OpenAPI schema with custom configurations.
      operationId: createOpenApiTool
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tool_set_name:
                  type: string
                  description: Name for the tool set (prefixed with `openapi-`).
                openapi_schema:
                  type: object
                  description: OpenAPI schema for tool definition.
                default_headers:
                  type: object
                  additionalProperties:
                    type: string
                  description: Optional default headers for requests.
                default_query_params:
                  type: object
                  additionalProperties:
                    type: string
                  description: Optional default query parameters.
                default_body_params:
                  type: object
                  additionalProperties:
                    type: string
                  description: Optional default body parameters.
                endpoint_defaults:
                  type: object
                  description: Optional endpoint-specific default parameters.
                enhance_descriptions:
                  type: boolean
                  description: Whether to enhance descriptions using OpenAI.
                openai_api_key:
                  type: string
                  nullable: true
                  description: OpenAI API key (if enhancement is enabled).
      responses:
        '200':
          description: Tools created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  tool_ids:
                    type: array
                    items:
                      type: string
        '400':
          description: Invalid request payload
        '401':
          description: Unauthorized - Invalid API key
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````