API v1
Custom Functions
Custom Functions

Generate Custom Function

AI-generate a custom function from a natural language description. Provide a 'query' describing what the function should do, and optionally 'user_function' (existing code to improve) or 'import_curl' (a cURL command to convert into a function). Returns the generated Python source code.

post/v1/custom_functions/generate

Request

  • Base URL
    https://api.xpander.ai (the document declares no server; this is the origin it was published from)
  • Auth
    API key in header x-api-key

Request body

querystring nullable

Natural language description of what the function should do. Examples: 'Calculate compound interest given principal, rate, and years', 'Parse a CSV string and return the headers and first 5 rows'.

user_functionstring nullable

Optional existing source code to improve or modify. The AI will use this as a starting point.

import_curlstring nullable

Optional cURL command to convert into a custom function. The AI will parse the cURL and generate a function that makes the equivalent HTTP request.

Response

Successful Response

custom_functionstring required

Generated Python source code defining xpander_run_action(...).

Changes

No recorded changes to this operation across all 4 revisions of this API.