# Real API Test Plan

This plan keeps live EvoLink tests as cheap as possible while still proving that the repository can drive real model calls.

## Non-Billable Tests

Run these before any real API call:

```bash
node scripts/validate-skills.mjs
node scripts/smoke-install-skills.mjs
```

They validate repository structure, skills.sh compatibility, local install, and lockfile behavior. They do not call EvoLink APIs.

## Billable Test 1: GPT Image 2 Minimal Smoke Test

Default command:

```bash
node scripts/real-api-smoke-test.mjs
```

Cheapest profile:

```json
{
  "model": "gpt-image-2",
  "size": "1:1",
  "resolution": "1K",
  "quality": "low",
  "n": 1
}
```

Purpose:

- Verify `EVOLINK_API_KEY` works.
- Verify `/v1/images/generations` accepts the request.
- Verify polling through `/v1/tasks/{task_id}`.
- Verify at least one final result URL is returned.

## Billable Test 2: Seedance 2 Minimal Smoke Test

Only run this after the image test passes:

```bash
node scripts/real-api-smoke-test.mjs --video
```

Cheapest profile:

```json
{
  "model": "seedance-2.0-text-to-video",
  "duration": 4,
  "quality": "480p",
  "aspect_ratio": "16:9",
  "generate_audio": false
}
```

Purpose:

- Verify `/v1/videos/generations` accepts the request.
- Verify the lowest video duration and resolution path works.
- Verify polling returns a final video URL.

## Reports

Every real API run writes a local Markdown report under `test-results/`.

The report includes:

- Date
- Status
- Redacted API key
- Request payload
- Cheapest profile
- Task creation response
- Final task response
- Result URL or error

`test-results/` is ignored by git so task IDs, URLs, and account-specific responses are not pushed accidentally.

## Alternate Env Source

By default, the script reads `.env`. To force the script to use only `process.env`, run:

```bash
EVOLINK_API_KEY=your_key node scripts/real-api-smoke-test.mjs --dotenv none
```

The argument is named `--dotenv` intentionally. Do not use `--env-file`; Node.js has its own `--env-file` option and may intercept it before the script sees it.
