Commit 1ce03e
2024-08-19 16:06:05 admin: Initialhome.md .. | |
@@ 1,28 1,175 @@ | |
- | ## Welcome to your wiki! |
- | |
- | Your Otter Wiki is up and running. |
- | |
- | This is your [[Home]] Page, the first page you see when you access your |
- | wiki. |
- | |
- | The first steps you might want to do: |
- | |
- | 1. [Register an account](/-/register). The very first account is an |
- | admin account which is able to configure the wiki. |
- | 2. Check the [configuration](/-/admin#application_preferences) of your wiki. |
- | You can change its name, configure the permissions necessary to |
- | view and edit pages or upload attachments. |
- | 3. If you require users to confirm their email address (recommended), |
- | make sure that you will configure and test your [Email Preferences](/-/admin#mail_preferences). |
- | 4. [Edit your Home](/Home/edit)! Do not like the change? Visit the |
- | page [history](/Home/history) and revert any change ever made. |
- | 5. You can [attach](/Home/attachments) images and other files to any page |
- | and then display them and link to them inside the page. |
- | 6. [Create new pages](/-/create)! If you need help with the Markdown syntax, |
- | check out the [Markdown guide](/-/help/syntax). |
- | 7. Read the [user guide](/-/help) and learn about An Otter Wikis features. |
- | |
- | We hope that An Otter Wiki is just what you are looking for. |
- | If you have any suggestions, feature requests or run into any |
- | issues, please reach out and report them |
- | via [github](https://github.com/redimp/otterwiki/issues). |
+ | # AI-Now Image and Video Generation API Documentation |
+ | |
+ | ## Table of Contents |
+ | |
+ | 1. [Introduction](#introduction) |
+ | 2. [Authentication](#authentication) |
+ | 3. [API Endpoints](#api-endpoints) |
+ | - [Ping](#ping) |
+ | - [Generate](#generate) |
+ | 4. [Models](#models) |
+ | 5. [Styles](#styles) |
+ | 6. [Error Handling](#error-handling) |
+ | 7. [Rate Limiting and Tokens](#rate-limiting-and-tokens) |
+ | 8. [Examples](#examples) |
+ | |
+ | ## Introduction |
+ | |
+ | This API provides access to various AI models for generating music, images, and videos based on text prompts. It supports multiple models with different capabilities and token costs. |
+ | |
+ | ## Authentication |
+ | |
+ | Authentication is required for all API requests. Use Bearer token authentication by including an API key in the Authorization header: |
+ | |
+ | ``` |
+ | Authorization: Bearer YOUR_API_KEY |
+ | ``` |
+ | |
+ | To obtain an API key, contact [email protected]. |
+ | |
+ | ## API Endpoints |
+ | |
+ | ### Ping |
+ | |
+ | Endpoint: `GET /api/ping` |
+ | |
+ | Use this endpoint to check if the API is operational. |
+ | |
+ | **Response:** |
+ | ``` |
+ | pong |
+ | ``` |
+ | |
+ | ### Generate |
+ | |
+ | Endpoint: `POST /api/generate` |
+ | |
+ | This endpoint generates music, images, or videos based on the specified model and prompt. |
+ | |
+ | **Request Body:** |
+ | |
+ | ```json |
+ | { |
+ | "model": "string", |
+ | "prompt": "string", |
+ | "style": "string" (optional) |
+ | } |
+ | ``` |
+ | |
+ | - `model`: The AI model to use (e.g., "suno", "luma", "pika", "run") |
+ | - `prompt`: The text prompt for generation |
+ | - `style`: Optional style parameter for some models |
+ | |
+ | **Response:** |
+ | |
+ | The response is a server-sent event stream. Events include: |
+ | |
+ | - Processing updates |
+ | - Error messages |
+ | - Final result with generated content URL |
+ | |
+ | ## Models |
+ | |
+ | 1. **Suno** (Music Generation) |
+ | - Token Cost: 10 |
+ | - Generation Time: 1-3 minutes |
+ | |
+ | 2. **Luma** (Video Generation) |
+ | - Token Cost: 30 |
+ | - Generation Time: Variable, may fail during peak hours |
+ | |
+ | 3. **Pika** (Video Generation) |
+ | - Token Cost: 10 |
+ | - Generation Time: 1-3 minutes |
+ | |
+ | 4. **Run** (Video Generation) |
+ | - Token Cost: 30 |
+ | - Generation Time: 1-3 minutes |
+ | |
+ | ## Styles |
+ | |
+ | ### Pika API Styles |
+ | |
+ | - Anime (value: '1') |
+ | - Moody (value: '2') |
+ | - 3D (value: '3') |
+ | - Watercolor (value: '4') |
+ | - Natural (value: '5') |
+ | - Claymation (value: '6') |
+ | - Black & White (value: '7') |
+ | |
+ | ### Run API Styles |
+ | |
+ | - Abandoned (value: 'abandoned') |
+ | - Abstract Sculpture (value: 'abstract_sculpture') |
+ | - Anime (value: 'anime') |
+ | - Cartoon (value: 'cartoon') |
+ | - Cine Lens (value: 'cine_lens') |
+ | - Claymation (value: 'claymation') |
+ | - Concept Art (value: 'concept_art') |
+ | - Digital Art (value: 'digital_art') |
+ | - Forestpunk (value: 'forestpunk') |
+ | - Frost (value: 'frost') |
+ | - Graphic Novel (value: 'graphic_novel') |
+ | - Graphite (value: 'graphite') |
+ | - Isometric 3D (value: 'isometric_3d') |
+ | - Low Poly 3D (value: 'low_poly_3d') |
+ | - Marker Drawing (value: 'marker_drawing') |
+ | - Moody Film (value: 'moody_film') |
+ | - Pixel Art (value: 'pixel_art') |
+ | - Retro (value: 'retro') |
+ | - Sci-fi Art (value: 'sci_fi_art') |
+ | - Stickers (value: 'stickers') |
+ | - Storyboard (value: 'storyboard') |
+ | - Thriller (value: 'thriller') |
+ | - 3D Cartoon (value: '3d_cartoon') |
+ | - 3D Render (value: '3d_render') |
+ | - 80s Vaporwave (value: '80s_vaporwave') |
+ | |
+ | ## Error Handling |
+ | |
+ | The API returns appropriate HTTP status codes and error messages: |
+ | |
+ | - 401: Unauthorized (missing or invalid API key) |
+ | - 418: Insufficient tokens |
+ | - 500: Internal Server Error |
+ | |
+ | Error responses are in JSON format: |
+ | |
+ | ```json |
+ | { |
+ | "status": "Error", |
+ | "message": "Error description" |
+ | } |
+ | ``` |
+ | |
+ | ## Rate Limiting and Tokens |
+ | |
+ | Each API key has a token balance. Tokens are deducted for each generation request based on the model used. Ensure your account has sufficient tokens before making requests. |
+ | |
+ | ## Examples |
+ | |
+ | ### Generate a song using Suno |
+ | |
+ | ```bash |
+ | curl -X POST https://api.ai-now.space/api/generate \ |
+ | -H "Authorization: Bearer YOUR_API_KEY" \ |
+ | -H "Content-Type: application/json" \ |
+ | -d '{ |
+ | "model": "suno", |
+ | "prompt": "A upbeat pop song about summer" |
+ | }' |
+ | ``` |
+ | |
+ | ### Generate a video using Pika with a specific style |
+ | |
+ | ```bash |
+ | curl -X POST https://api.ai-now.space/api/generate \ |
+ | -H "Authorization: Bearer YOUR_API_KEY" \ |
+ | -H "Content-Type: application/json" \ |
+ | -d '{ |
+ | "model": "pika", |
+ | "prompt": "A serene lake surrounded by mountains", |
+ | "style": "4" |
+ | }' |
+ | ``` |