max developers SDK 0.4.0
API reference

Create

POST /v1/max-code/creations

This operation can change data. Use resources you control.

This operation can spend credits. Save the request or run identifier before retrying.

Request fields

FieldLocationTypeRequired
actionbodycreate | revise | export | status | cancelOptional
api_key_idbodystring | nullOptional
api_key_namebodystring | nullOptional
asset_keysbodyList of stringOptional
attachment_idsbodyList of stringOptional
authoring_modebodychat | workspaceOptional
briefbodystringOptional
deliverablesbodyList of DeliverableOptional
expected_revisionbodyinteger | nullOptional
filesbodyList of object | nullOptional
formatsbodyList of docx | pptx | xlsx | pdf | websiteOptional
idempotency_keybodystring | nullOptional
project_idbodystring | nullOptional
run_idbodystring | nullOptional
workspace_templatebodyproposal | report | budget | pitch | latex | nullOptional
workspace_titlebodystring | nullOptional

Examples

Use the environment settings from Quickstart. Replace sample resource IDs with your own. The examples show the required request shape.

import { MaxClient } from "@elmax/api";

const max = new MaxClient({
  baseURL: process.env.MAX_API_URL,
  apiKey: process.env.MAX_API_KEY,
});

const result = await max.api.postV1MaxCodeCreations({
  "body": {
    "action": "create",
    "brief": "Create a one-page onboarding brief.",
    "formats": [
      "docx"
    ],
    "idempotency_key": "brief-request-001"
  }
});
console.log(result);
import os
from elmax_ai import MaxClient

with MaxClient(base_url=os.environ["MAX_API_URL"], api_key=os.environ["MAX_API_KEY"]) as max:
    result = max.api.post_v1_max_code_creations(**{'body': {'action': 'create',
          'brief': 'Create a one-page onboarding brief.',
          'formats': ['docx'],
          'idempotency_key': 'brief-request-001'}})
    print(result)

Errors and recovery