{"id":31556139,"url":"https://github.com/jongan69/aiapi","last_synced_at":"2025-10-04T22:49:12.475Z","repository":{"id":287781513,"uuid":"965769758","full_name":"jongan69/aiapi","owner":"jongan69","description":"Im tired of paying boss","archived":false,"fork":false,"pushed_at":"2025-08-12T04:25:22.000Z","size":21812,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-12T06:25:38.202Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://aiapi-tno8.onrender.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jongan69.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-13T21:32:11.000Z","updated_at":"2025-08-12T04:25:23.000Z","dependencies_parsed_at":"2025-08-12T06:18:42.411Z","dependency_job_id":null,"html_url":"https://github.com/jongan69/aiapi","commit_stats":null,"previous_names":["jongan69/aiapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jongan69/aiapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Faiapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Faiapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Faiapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Faiapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jongan69","download_url":"https://codeload.github.com/jongan69/aiapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Faiapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278386117,"owners_count":25978109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-04T22:49:11.392Z","updated_at":"2025-10-04T22:49:12.469Z","avatar_url":"https://github.com/jongan69.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI API\n\nA powerful API for interacting with various AI models, built with FastAPI.\n\n## Overview\n\nThis API provides endpoints for:\n- Chatting with AI models using streaming responses\n- Generating images with various models\n- Creating image variations\n- Generating audio (including elevator pitches)\n- Transcribing audio\n- Generating videos\n\nAll endpoints are fully documented with examples and detailed descriptions.\n\n## Features\n\n- **Chat**: Interact with AI models using streaming responses\n- **Image Generation**: Generate images with various models\n- **Image Variations**: Create variations of existing images\n- **Audio Generation**: Generate audio from text, including elevator pitches\n- **Audio Transcription**: Transcribe audio files\n- **Video Generation**: Generate videos based on prompts\n- **CORS Support**: Configured to allow cross-origin requests\n\n## Setup\n\n### Prerequisites\n\n- Python 3.8+\n- pip\n\n### Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/jongan69/aiapi.git\n   cd aiapi\n   ```\n\n2. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. Set up environment variables:\n   Create a `.env` file in the root directory with the following variables:\n   ```\n   PROXY_URL=your_proxy_url\n   PORT=8000\n   HF_TOKEN=your_huggingface_token\n   ```\n\n4. Run the server:\n   ```bash\n   python main.py\n   ```\n\nThe server will start at `http://localhost:8000`.\n\n## API Documentation\n\n### Chat\n\n**Endpoint:** `POST /chat/`\n\n**Request Body:**\n```json\n{\n  \"messages\": [\n    {\"role\": \"user\", \"content\": \"Hello, how are you?\"}\n  ],\n  \"model\": \"auto\",\n  \"chunk_size\": 1500,\n  \"wrap_input\": false,\n  \"json_mode\": false,\n  \"stream\": false\n}\n```\n\n**Response:**\n```json\n{\n  \"response\": \"I'm doing well, thank you for asking!\"\n}\n```\n\n### Image Generation\n\n**Endpoint:** `POST /images/generate/`\n\n**Request Body:**\n```json\n{\n  \"prompt\": \"A beautiful sunset over the ocean\",\n  \"model\": \"midjourney\",\n  \"response_format\": \"url\"\n}\n```\n\n**Response:**\n```json\n{\n  \"url\": \"https://example.com/image.jpg\"\n}\n```\n\n### Image Variations\n\n**Endpoint:** `POST /images/variations/`\n\n**Request Body:**\n```\nfile: [binary file]\nmodel: sdxl-turbo\nresponse_format: url\n```\n\n**Response:**\n```json\n{\n  \"url\": \"https://example.com/variation.jpg\"\n}\n```\n\n### Audio Generation\n\n**Endpoint:** `POST /audio/generate/`\n\n**Request Body:**\n```json\n{\n  \"text\": \"Hello, this is a test.\",\n  \"model\": \"gpt-4o-mini-tts\",\n  \"voice\": \"alloy\",\n  \"format\": \"mp3\",\n  \"provider\": \"OpenAIFM\"\n}\n```\n\n**Response:**\n```\n[Binary audio file]\n```\n\n### Audio Elevator Pitch\n\n**Endpoint:** `POST /audio/elevator_pitch/`\n\n**Request Body:**\n```json\n{\n  \"prompt\": \"My new AI startup\",\n  \"model\": \"gpt-4o-mini\",\n  \"audio_model\": \"openai-audio\",\n  \"voice\": \"alloy\",\n  \"format\": \"mp3\",\n  \"provider\": \"PollinationsAI\"\n}\n```\n\n**Response:**\n```\n[Binary audio file]\n```\n\n### Audio Transcription\n\n**Endpoint:** `POST /audio/transcribe/`\n\n**Request Body:**\n```\nfile: [binary file]\nmodel: whisper\n```\n\n**Response:**\n```json\n{\n  \"transcription\": \"This is the transcribed text.\"\n}\n```\n\n### Video Generation\n\n**Endpoint:** `POST /video/generate/`\n\n**Request Body:**\n```json\n{\n  \"prompt\": \"A beautiful sunset over the ocean\",\n  \"model\": \"stable-diffusion\",\n  \"resolution\": \"720p\",\n  \"aspect_ratio\": \"16:9\",\n  \"n\": 1,\n  \"response_format\": \"url\"\n}\n```\n\n**Response:**\n```json\n{\n  \"urls\": [\"https://example.com/video.mp4\"]\n}\n```\n\n## Available Models\n\n### Text Models\n\n**Endpoint:** `GET /models/`\n\n**Response:**\n```json\n{\n  \"models\": [\"gpt-4\", \"gpt-3.5-turbo\", \"claude-2\", \"palm-2\"]\n}\n```\n\n### Image Models\n\n**Endpoint:** `GET /models/image/`\n\n**Response:**\n```json\n{\n  \"models\": [\"midjourney\", \"dall-e-3\", \"stable-diffusion\"]\n}\n```\n\n### Video Models\n\n**Endpoint:** `GET /models/video/`\n\n**Response:**\n```json\n{\n  \"models\": [\"stable-diffusion\", \"runway\"]\n}\n```\n\n### Audio Models\n\n**Endpoint:** `GET /models/audio/`\n\n**Response:**\n```json\n{\n  \"models\": [\"gpt-4o-mini-tts\", \"openai-audio\", \"hypnosis-tracy\"]\n}\n```\n\n### Audio Voices\n\n**Endpoint:** `GET /models/audio/voices/`\n\n**Response:**\n```json\n{\n  \"voices\": [\"alloy\", \"ash\", \"ballad\", \"coral\", \"echo\", \"fable\", \"onyx\", \"nova\", \"sage\", \"shimmer\", \"verse\"]\n}\n```\n\n## CORS Support\n\nThe API is configured to allow cross-origin requests. CORS headers are set on all responses, including file and streaming responses.\n\n## License\n\nMIT\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjongan69%2Faiapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjongan69%2Faiapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjongan69%2Faiapi/lists"}