Skip to content

Quickstart

Write a tool, test it, publish it, and call it from anywhere — in under 5 minutes.


Step 1: Create a tool

  1. Sign in and click Create Tool from your dashboard
  2. Fill in the basics:
    • Name: hello-world
    • Type: Function
    • Runtime: Python 3.13
  3. Click Create

Step 2: Write your handler

In Step 2 (Code & Test), replace the default code with:

def cortexone_handler(event, context):
name = event.get("name", "World")
return {
"statusCode": 200,
"body": {"message": f"Hello, {name}!"}
}

Step 3: Test it

In the Test panel on the right, enter a test event and click Run:

{ "name": "Alice" }

You should see:

{ "statusCode": 200, "body": { "message": "Hello, Alice!" } }

Step 4: Publish

  1. Go to Step 6 (Publish)
  2. Set the price to 0 (free)
  3. Click Publish as Private — your tool is now live within your organization

Step 5: Get your function ID and version

After publishing, open your tool’s detail page. Copy the Function ID (a UUID) and the version string (e.g. 1.0.0) — both are shown on the page.


Step 6: Generate an API key

  1. Go to Settings → Workspace → API Keys
  2. Click Generate New Token
  3. Give it a name and set an expiry
  4. Copy the key immediately

Step 7: Make your first API call

Terminal window
curl 'https://cortexconnect.rival.io/api/v1/functions/<function_id>/1.0.0/invoke' \
--header 'Authorization: <your_api_key>' \
--header 'Content-Type: application/json' \
--data '{"event": {"name": "Alice"}}'

You should get back:

{
"statusCode": 200,
"body": "{\"message\": \"Hello, Alice!\"}",
"summary": {
"runtime_ms": 8,
"memory_used_mb": 45,
"compute_type": "python"
}
}

What’s next?

  • Store secrets safely — use environment variables instead of hardcoding: Environment Variables
  • Try JavaScript or Lua — lighter runtimes with faster cold starts: Writing Code
  • Publish publicly — list your tool on the marketplace: Versions & Publishing
  • Build an MCP server — let AI agents discover and invoke your tool: MCP