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

# Get Function Definition

> Return the function definition that can be used directly by LLM.
The actual content depends on the intended model (inference provider, e.g., OpenAI, Anthropic, etc.) and the function itself.



## OpenAPI

````yaml get /v1/functions/{function_name}/definition
openapi: 3.1.0
info:
  title: Aipolabs
  version: 0.0.1-beta.3
servers: []
security: []
paths:
  /v1/functions/{function_name}/definition:
    get:
      tags:
        - functions
      summary: Get Function Definition
      description: >-
        Return the function definition that can be used directly by LLM.

        The actual content depends on the intended model (inference provider,
        e.g., OpenAI, Anthropic, etc.) and the function itself.
      operationId: functions-get_function_definition
      parameters:
        - name: function_name
          in: path
          required: true
          schema:
            type: string
            title: Function Name
        - name: inference_provider
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/InferenceProvider'
            description: >-
              The inference provider, which determines the format of the
              function definition.
            default: openai
          description: >-
            The inference provider, which determines the format of the function
            definition.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/OpenAIFunctionDefinition'
                  - $ref: '#/components/schemas/AnthropicFunctionDefinition'
                title: Response Functions-Get Function Definition
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    InferenceProvider:
      type: string
      enum:
        - openai
        - anthropic
      title: InferenceProvider
    OpenAIFunctionDefinition:
      properties:
        type:
          type: string
          enum:
            - function
          const: function
          title: Type
          default: function
        function:
          $ref: '#/components/schemas/OpenAIFunction'
      type: object
      required:
        - function
      title: OpenAIFunctionDefinition
    AnthropicFunctionDefinition:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        input_schema:
          type: object
          title: Input Schema
      type: object
      required:
        - name
        - description
        - input_schema
      title: AnthropicFunctionDefinition
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    OpenAIFunction:
      properties:
        name:
          type: string
          title: Name
        strict:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Strict
        description:
          type: string
          title: Description
        parameters:
          type: object
          title: Parameters
      type: object
      required:
        - name
        - description
        - parameters
      title: OpenAIFunction
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API key for authentication
      in: header
      name: X-API-KEY

````