diff --git a/shurly_service/shurly_service.module b/shurly_service/shurly_service.module
index 7d0e763..def9249 100644
--- a/shurly_service/shurly_service.module
+++ b/shurly_service/shurly_service.module
@@ -13,7 +13,7 @@
  * Implementation of hook_perm().
  */
 function shurly_service_perm() {
-  $perms = array('administer short URL services');
+  $perms = array('administer short URL services','authenticate using api key');
 
   return $perms;
 }
@@ -27,7 +27,7 @@ function shurly_service_menu() {
   $items['shurly/api/shorten'] = array(
     'file'             => 'shurly_service.inc',
     'page callback'    => 'shurly_service_shorten',
-    'access arguments' => array('Create short URLs'),
+    'access callback'  => 'shurly_service_access_api_key',
     'type'             => MENU_CALLBACK,
   );
   $items['shurly/api/expand'] = array(
@@ -40,6 +40,16 @@ function shurly_service_menu() {
   return $items;
 }
 
+function shurly_service_access_api_key() {
+
+  if ($_REQUEST['apiKey'] && user_access('authenticate using api key')) {
+    module_load_include('inc', 'shurly_service', 'shurly_api_keys');
+    $api_validation = (is_numeric(shurly_get_uid($_REQUEST['apiKey']))) ? TRUE : FALSE;
+  }
+    
+  return user_access('Create short URLs') || $api_validation;
+}
+
 function shurly_service_block($op = 'list', $delta = 0, $edit = array()) {
   // create a block to add URL
   switch ($op) {
