> ## 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 Tool Credential Endpoint

> Creates a new credential for a tool.

### Description

This endpoint creates a new credential for a tool.

### Endpoint

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

### Authentication

API Key (x-api-key) must be included in the header.

### Request Body

```json theme={null}
{
  "name": "string",
  "provider_id": "string",
  "credentials": {},
  "meta_data": {}
}
```

### Response

A message confirming that the credential was created.

### Example Request

```sh theme={null}
curl -X POST "https://agent-prod.studio.lyzr.ai/v3/tools/credentials" ^
-H "accept: application/json" ^
-H "content-type: application/json" ^
-H "x-api-key: sk-default-EXAMPLEKEY123" ^
-d "{\"name\":\"string\",\"provider_id\":\"string\",\"credentials\":{},\"meta_data\":{}}"
```

***


## OpenAPI

````yaml post /tools/credentials
openapi: 3.0.3
info:
  title: Lyzr Tool Credential API
  version: 1.0.0
servers:
  - url: https://agent-prod.studio.lyzr.ai/v3
security: []
paths:
  /tools/credentials:
    post:
      tags:
        - Tool Credentials
      summary: Create Tool Credential
      description: Creates a new credential for a tool.
      operationId: createToolCredential
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the credential.
                provider_id:
                  type: string
                  description: The provider ID this credential is associated with.
                credentials:
                  type: object
                  additionalProperties: true
                  description: Key-value pairs of the actual credentials.
                meta_data:
                  type: object
                  additionalProperties: true
                  description: Additional metadata related to the credential.
              required:
                - name
                - provider_id
                - credentials
      responses:
        '200':
          description: Credential created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Credential created successfully.
        '400':
          description: Bad Request – Invalid input
        '401':
          description: Unauthorized – API key missing or invalid
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````