Skip to main content
These clients use Node.js 18 or newer and Python 3. They need no extra packages. For a first request without a helper file, use the quickstart.

Set your API key

Create an API key, then set it in the shell where you run your examples:

Save the client

Save the Node.js code as url2llm.mjs or the Python code as url2llm.py. Keep it in the same folder as the example you want to run.
request returns the full JSON response. Read the result from data. ApiError preserves the HTTP status, error code, request ID, and Retry-After header. Non-JSON error responses use a generic message while keeping the HTTP status and retry header. Malformed successful responses and network errors are raised without copying their bodies into error messages. pages follows next_cursor until it is null. It works with collection history and page results, including an integer cursor of zero. Pass a saved cursor as the third argument to resume a read.

Run an example

Save a guide’s Node.js example as example.mjs and run node example.mjs. For Python, save it as example.py and run python3 example.py. Generate an operation key once for a new request. Keep it with your task and reuse it for identical retries. These clients do not generate keys or retry automatically. See retries for a working retry example. Keep these clients on your server or in a local script. Never put the secret in browser code. Their HTTP timeout is 190 seconds; a client timeout does not cancel work already accepted by the API.