Multispecies API — AI Usage Guide

This page provides instructions for AI assistants helping users write code, analyse data, or conduct scientific and forestry modelling using the Multispecies API.

Authoritative documentation

Instructions for AI assistants

When a user asks you to use the Multispecies API, follow these instructions before writing code or conducting an analysis.

  1. Read the OpenAPI specification. Retrieve and inspect https://api.multispecies.nz/openapi.json . Do not rely solely on the /doc page, which is rendered with JavaScript and may not be readable by your browsing tools. If you cannot retrieve the specification directly, try another available method before concluding that it is inaccessible.
  2. Read the relevant usage guidance. Consult the Getting Started section and applicable examples in the API documentation. Use the OpenAPI specification as the authoritative source for endpoint names, HTTP methods, parameters, request formats, response schemas, and authentication requirements. Where this page and an example in the specification disagree, follow this page for the points it states explicitly, and the specification for everything else.
  3. Identify the appropriate workflow. Select the documented endpoint that matches the user's objective. Do not assume that an endpoint supports a particular operation without checking its specification.
  4. Understand the model and its outputs. Check parameter descriptions, units, defaults, and constraints, and the meaning of each output field. Results are model projections, not observations. Do not invent field names, units, scientific relationships, or unsupported capabilities.
  5. Produce a useful solution. Tailor the code and analysis to the user's request rather than merely demonstrating a basic API call. For analytical tasks, this may include parameter sweeps, comparisons between species, tables, plots, summary statistics, or sensitivity analysis, where the API supports them.

Hard rules

These constraints are easy to miss in the specification. Follow them exactly.

Python scripts and analysis

Unless the user requests another language or format, use Python for code examples. Aim to provide complete, runnable scripts suitable for users who may not be professional software developers.

Running analyses

If the user wants an analysis rather than just a script, and you have the necessary execution tools, network access, and API credentials, perform the analysis and explain the method and results.

If you cannot execute the requests yourself, provide a complete script the user can run. Clearly distinguish actual API results from illustrative examples or expected output. Never claim to have run an analysis that you have not executed.

Handling uncertainty

Make reasonable, explicit assumptions when the user's objective is clear but some optional inputs are unspecified. If a required detail cannot be established from the documentation or the user, explain the uncertainty and ask a focused question. Never silently substitute invented API functionality or unsupported scientific assumptions.

For users

To get started, tell your AI assistant what you want to investigate and reference this page. For example:

Use the Multispecies API, following the instructions at https://api.multispecies.nz/ai, to investigate how mean annual temperature affects predicted carbon yields for different tree species. Write a Python script that performs the analysis and plots the results.

Mean annual temperature is growth_parameters.meanAnnualTemperature. Species, site index, 300 Index, stocking, and rotation length are still required. Replace the example with any question you want to explore. You do not need to know the API endpoints or request formats in advance.